Skip to content

sars

Species-area relationship curve fitting in Python.

PyPI DOI CI

A conceptual mirror of the R sars package (Matthews et al. 2019), native to the Python scientific stack.

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
  • Threshold models -- piecewise regression for detecting breakpoints (small island effect)
  • I/O adapters -- load from CSV, GeoDataFrame, or pyiNaturalist summaries
  • 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)

Citation

If you use this software, please cite it:

McMeen, J. (2026). sars: Species-area relationship curve fitting in Python. DOI