Species-area relationship curve fitting in Python
Project description
sars
Species-area relationship curve fitting in Python.
A conceptual mirror of the R sars package (Matthews et al. 2019), native to the Python scientific stack.
Installation
pip install sars
Features
- 20 SAR models — power, logarithmic, asymptotic, sigmoid, and more
- Multi-model inference — fit all models at once, ranked by AICc with Akaike weights
- Model averaging — weighted-average predictions across candidate models
- Bootstrap confidence intervals — percentile-based CIs for averaged predictions
- R-validated — all models tested against R
sarspackage reference values
Quick start
import sars
# Load the built-in Galapagos dataset (Preston 1962)
galap = sars.load_galap()
# Fit a single model
fit = sars.sar_power(galap)
print(fit)
# SARFit(model='power', c=33.1792 z=0.2832, R²=0.4912, AICc=189.03)
# Fit all 20 models and compare
multi = sars.sar_multi(galap)
print(multi.summary[["model", "AICc", "delta_AICc", "weight"]].head())
# Model-averaged predictions
avg = sars.sar_average(galap)
predictions = avg.predict([1.0, 10.0, 100.0])
# Bootstrap confidence intervals
ci = sars.bootstrap_ci(galap, n_boot=100)
Available models
| Type | Models |
|---|---|
| Non-asymptotic | power, powerR, loga, linear, epm1, epm2, p1, p2 |
| Asymptotic convex | koba, monod, negexpo, asymp, ratio |
| Asymptotic sigmoid | mmf, gompertz, weibull3, weibull4, chapman, betap, heleg |
Each model has a dedicated function (e.g. sars.sar_power(), sars.sar_negexpo()) and returns a SARFit object with parameters, R², AIC, AICc, and BIC.
Citation
If you use this software, please cite it:
McMeen, J. (2026). sars: Species-area relationship curve fitting in Python.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sars-0.6.0.tar.gz.
File metadata
- Download URL: sars-0.6.0.tar.gz
- Upload date:
- Size: 26.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d5a1bad64d824105c2a4a8377685859ff15f12c1e2fed83c906ad39b3bc97053
|
|
| MD5 |
87ff8d0150906356a35fe32c715a6c4c
|
|
| BLAKE2b-256 |
f4e81315cdb6acf291b5300302463de356652965e6a6899d4d454c03dd3a06ae
|
Provenance
The following attestation bundles were made for sars-0.6.0.tar.gz:
Publisher:
publish.yml on jmcmeen/sars
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sars-0.6.0.tar.gz -
Subject digest:
d5a1bad64d824105c2a4a8377685859ff15f12c1e2fed83c906ad39b3bc97053 - Sigstore transparency entry: 1229772140
- Sigstore integration time:
-
Permalink:
jmcmeen/sars@e504d2e588f60b214d2c7db15f707632af738c30 -
Branch / Tag:
refs/tags/v0.6.0 - Owner: https://github.com/jmcmeen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e504d2e588f60b214d2c7db15f707632af738c30 -
Trigger Event:
push
-
Statement type:
File details
Details for the file sars-0.6.0-py3-none-any.whl.
File metadata
- Download URL: sars-0.6.0-py3-none-any.whl
- Upload date:
- Size: 19.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3979af5efe727b5a00d789d01bc4c7e8f6198cd8f504236d034968b98ef0f5a3
|
|
| MD5 |
466c9d3cf5bb76cfd1bc80bc7528b5b7
|
|
| BLAKE2b-256 |
a628937f2bbc16ee1b5959e1f01d88ecf76418d11489a08ab8e3c5ecdfe4e998
|
Provenance
The following attestation bundles were made for sars-0.6.0-py3-none-any.whl:
Publisher:
publish.yml on jmcmeen/sars
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sars-0.6.0-py3-none-any.whl -
Subject digest:
3979af5efe727b5a00d789d01bc4c7e8f6198cd8f504236d034968b98ef0f5a3 - Sigstore transparency entry: 1229772144
- Sigstore integration time:
-
Permalink:
jmcmeen/sars@e504d2e588f60b214d2c7db15f707632af738c30 -
Branch / Tag:
refs/tags/v0.6.0 - Owner: https://github.com/jmcmeen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e504d2e588f60b214d2c7db15f707632af738c30 -
Trigger Event:
push
-
Statement type: