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.2.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.2-py3-none-any.whl (38.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bayes_compass-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 825812b5f3d40721df98d2054b9d868cda76cb3408047a77023e8aa1214fc71d
MD5 ed8fbc86adaf55db6cf4c50040f46c35
BLAKE2b-256 7351e4cabd57741e6db637a968ef000d3a6cd3c4bfd318ef200d6f030d1bacd4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: bayes_compass-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5a7947a834ea8a69570e74296bb3f0c6a05af5a277e322251d4d231692ec03c9
MD5 bc5929040478c6fd591cd4c7553e8742
BLAKE2b-256 b9663f2be6cca9900ed0485a342d103fcc6095f6ea2eab29888c5316daa088e3

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