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.4.tar.gz (255.5 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.4-py3-none-any.whl (38.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bayes_compass-0.1.4.tar.gz
  • Upload date:
  • Size: 255.5 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.4.tar.gz
Algorithm Hash digest
SHA256 66c11846a19788a2d3a35541914ee15a4130db3ad8ab86e7018585ccac5cf30a
MD5 f951e775b449b64898731db401916707
BLAKE2b-256 cfb1bbb7251e4eb9a580f9a686931b9000a70707918d52f508e057f9691e7e0b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: bayes_compass-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 38.6 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 42a787a4f6fd4a8e9cec9df6d76fdb77543f10f0a84a0d01bf22f8173fa933e0
MD5 c7784ba0c5fb51a3fbeadbb5f7a1f0c7
BLAKE2b-256 8be1eacb43dbbcbe3a32739a3a3d59992a1ac2995e035a9dd74f46d56e7cb926

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