Skip to content
/ rxmc Public

Uncertainty quantification and calibration of reaction models with Markov-Chain Monte Carlo, with flexible and composable models for the likelihood and corpus of constraints

License

Notifications You must be signed in to change notification settings

beykyle/rxmc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rxmc

Bayesian calibration of reaction models with Markov-Chain Monte Carlo, with flexible and composable models for the likelihood and body of evidence.

  • curate the corpus of experimental constraints (e.g. using exfor_tools)
  • efficiently calculate your model's corresponding predictions for these observables using jitR
  • choose from a variety of likelihood models, or extend the basic LikelihoodModel class to implement your own.
  • package the constraints, physical model (and solver), and likelihood model together in a Evidence object which provides the likelihood of a given model parameter, for use in Bayesian calibration
  • run Bayesian calibration using a Walker

An example of this code in use is in the development of the East Lansing Model

Check out the examples/ directory.

documentation

  • TBD

installation

pypi

  • TBD

for development

git clone git@github.com:beykyle/rxmc.git
cd rxmc

Then install an editable version locally like so:

pip install -ve .

It is highly recommended that you use an isolated virtual environment (e.g. using venv or conda/mamba), as this action will install all of the dependencies in requirements.txt, at the specific version required.

For example, with conda:

conda env create -f environment.yml
conda activate rxmc
pip install -ve . --no-deps

or, similarily, with mamba:

mamba env create -f environment.yml
mamba activate rxmc
pip install -ve . --no-deps

or with venv:

python -m venv .rxmc
source .rxmc/bin/activate
pip install -r requirements.txt
pip install -ve .

The advantages of conda and mamba is that they can install heavy binary dependencies like openmpi required by mpi4py.

Some users may want to use their own custom environment, e.g. setup using the module system on a cluster. If you don't want to create an isolated environment for rxmc, but also don't want pip to overwrite the package versions you havein your environment with the ones in requirements.txt, you can

pip install -ve . --no-deps

This will require that your current python environment satisfies requirements.txt.

test

python -m unittest discover ./test

examples, demos and tutorials

check out the examples/ directory

In particular, the following notebooks are useful for getting started with rxmc:

use with third party MCMC samplers

The Evidence class in rxmc can be used with any MCMC sampler that requires a function which returns the log-likelihood of a given parameter set. rxmc.config.CalibrationConfig provides a convenient way to package together an Evidence object with MCMC sampler settings, and can be used to run MCMC sampling with third party samplers like emcee or pymc. A fully fledged example of setting up an inference problem with rxmc, and then using an emcee EnsembleSampler to sample from the posterior in a massively parallel MPI approach can be found in examples/emcee/.

About

Uncertainty quantification and calibration of reaction models with Markov-Chain Monte Carlo, with flexible and composable models for the likelihood and corpus of constraints

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages