Skip to main content

Species-area relationship curve fitting in Python

Project description

sars

DOI

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 sars package 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. DOI

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sars-0.7.0.tar.gz (29.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sars-0.7.0-py3-none-any.whl (19.6 kB view details)

Uploaded Python 3

File details

Details for the file sars-0.7.0.tar.gz.

File metadata

  • Download URL: sars-0.7.0.tar.gz
  • Upload date:
  • Size: 29.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sars-0.7.0.tar.gz
Algorithm Hash digest
SHA256 3dafb49d130ce5d5f9daee3671f1313dbf056d5fba21eda5328f2e928dcac5f6
MD5 f09350b205bcb4de0e1280641f4b06c4
BLAKE2b-256 5feaaff92b6edab4b28234d2b891b7c3b4b5a56fe9ce7cd7941b4d48ee6a4f58

See more details on using hashes here.

Provenance

The following attestation bundles were made for sars-0.7.0.tar.gz:

Publisher: publish.yml on jmcmeen/sars

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sars-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: sars-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 19.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sars-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1090beec58d1fef8ed25b96c44eb3093c13227dcc4b813f1a39ab24816222876
MD5 b285fa77df784d68f4512deefbb4d9fa
BLAKE2b-256 44669b22dc7a36b36acd935b90194d9b350aabbe5a87d68478a9d3dd4d414b76

See more details on using hashes here.

Provenance

The following attestation bundles were made for sars-0.7.0-py3-none-any.whl:

Publisher: publish.yml on jmcmeen/sars

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page