Skip to content

timmh/biolith

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Biolith logo Biolith: Bayesian Ecological Modeling in Python

Test PyPI - Version

Biolith is a Python package designed for bayesian ecological modeling and analysis with a focus on occupancy modeling. It has similar goals to Unmarked and spOccupancy, but is written in Python and uses NumPyro and JAX to enable rapid model fitting and iteration.

Features

  • Hackable: Models are easy to understand and implement, no likelihood derivations needed.
  • Fast: Models can be fit on GPUs, which is fast.
  • Familiar: Everything is written in Python, making it easy to integrate into existing pipelines.

Installation

You can install Biolith using pip:

pip install git+https://github.com/timmh/biolith

Usage

Here is a simple example using simulated data to get you started:

from biolith.models import occu, simulate
from biolith.utils import fit

# Simulate dataset
data, true_params = simulate()

# Fit model to simulated data
results = fit(occu, **data)

# Compare estimated occupancy probability to the true mean occupancy
print(f"Mean estimated psi: {results.samples['psi'].mean():.2f}")
print(f"Mean true occupancy: {true_params['z'].mean():.2f}")

Real-world Example

To see a real-world example on camera trap data, see this Jupyter Notebook from the EFI Statistical Methods Seminar Series or Open In Colab

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contact

For questions or feedback, please open an issue or email haucke@mit.edu.

About

Bayesian Ecological Modeling in Python

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages