Skip to main content

COMPASS: A Python package for bayesian model comparison in a simulation based setting

Project description

PyPi version DOI Static Badge Static Badge Static Badge

COMPASS: Comparison Of Models using Probabilistic Assessment in Simulation-based Settings

COMPASS is a Python package designed for Bayesian Model Comparison in simulation-based settings. By comparing the predictive power of various models, it aims to identify the most suitable model for a given dataset.
It is especially suited for fields like astrophysics and computational biology, where simulation is integral to the modeling process.


Features

  • Perform Bayesian model comparison in simulation-based settings.
  • Simulate, train, and evaluate models with ease.
  • Tools for posterior model probability comparison.
  • Includes ModelTransfuser and ScoreBasedInferenceModel classes for seamless workflows.

Installation

Install the package using pip:

pip install bayes-compass

Usage

Model Comparison Example

The ModelTransfuser class provides a framework for model comparison workflows:

from compass import ModelTransfuser

# Initialize the ModelTransfuser
MTf = ModelTransfuser()

# Add data from simulators
MTf.add_data(model_name="Model1", train_data=data_1, val_data=val_data_1)
MTf.add_data(model_name="Model2", train_data=data_2, val_data=val_data_2)

# Initialize ScoreBasedInferenceModels
MTf.init_models()

# Train the models
MTf.train_models()

# Compare Posterior Model Probabilities
observations = load_your_observations
MTf.compare(x=observations, err=observations_err)

stats = MTf.stats

# Plot results
MTf.plots()

Simulation-Based Inference Example

The ScoreBasedInferenceModel class allows for estimating parameters using a score-based approach:

from compass import ScoreBasedInferenceModel

SBIm = ScoreBasedInferenceModel(node_size=128)

Contributing

Contributions are welcome! Feel free to open issues or submit pull requests to improve this package.


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

bayes_compass-0.1.3.tar.gz (255.4 kB view details)

Uploaded Source

Built Distribution

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

bayes_compass-0.1.3-py3-none-any.whl (38.5 kB view details)

Uploaded Python 3

File details

Details for the file bayes_compass-0.1.3.tar.gz.

File metadata

  • Download URL: bayes_compass-0.1.3.tar.gz
  • Upload date:
  • Size: 255.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for bayes_compass-0.1.3.tar.gz
Algorithm Hash digest
SHA256 68fe0e577973f5f817f7ca292dddbcb4e99079a6999830bde262fb050d146d2a
MD5 94d3a53b953526aac399aea930eb5be5
BLAKE2b-256 7c41edf765f6d90de0752b1048705e088cd0af9c3ae0f9313233b378e92cff07

See more details on using hashes here.

File details

Details for the file bayes_compass-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: bayes_compass-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 38.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for bayes_compass-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f2b613cd934817753cadfe05d2a75126bf18142f3d44d5d3757c0536222a0668
MD5 319fb1ff3535076ce52a2d30fa13dae4
BLAKE2b-256 662081a2a6496ee830ecaaff0dd26ff9ca8f86b81bc88c4e9bc280ac8bd17ce4

See more details on using hashes here.

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