Skip to content
forked from gmcgoldr/pymcmc

Application to planetary science problems of the Metropolis-Hastings algorithm for Markov Chain Monte Carlo sampling of multidimensional spaces.

License

Notifications You must be signed in to change notification settings

cshsgy/PlanetMCMC

 
 

Repository files navigation

PlanetMCMC

The implementation is based on PyMCMC, which is a rather simple starting point. Functionalities added:

  1. Convenient importation of new data
  2. Restart utility
  3. Burn-in setup
  4. Automatic weighting to focus on trends and spikes (anomalies)
  5. Naive parallelism

Functionalities to add: <A better and more general wrapper needed>

  1. MPI compatibility, as in this paper: https://arxiv.org/pdf/1311.4780.pdf.
  2. Interpretation of the results, such as marginal distribution and most likely solution. Also: add in-run plot results, generate diagnostic plots every some runs. The diagnostic plots can be specified by users.
  3. Possibly: the detection of a secondary likely solution.
  4. Incorporate sets of data and routines to easily include such data and combine them for likelihood estimation.
  5. Common models for likelihood estimation.
  6. Scripts for generating the plots.
  7. Rescaling adjustment to constrain the acceptane rate between 0.22 and 0.24
  8. ** Add in the geometry interpretation by SORA ** https://pypi.org/project/sora-astro/

Orig-PyMCMC

Simple implementation of the Metropolis-Hastings algorithm for Markov Chain Monte Carlo sampling of multidimensional spaces.

The implementation is minimalistic. All that is required is a funtion which accepts an iterable of parameter values, and returns the positive log likelihood at that point. The output can be stored either in memory by means of a numpy array, or in a ROOT::TTree.

Burning and thining is left to the user. For example data[1000::2] will burn 1000 samples and thin by a factor of two.

The loop is implemented purely in python. Consequently, it is useful when the likelihood evaluation is relatively slow such that the bottleneck isn't the python overhead.

The chain is not adaptive. It is best to learn appropriate scales in a separate run, and use these scales in future runs. This workflow is useful when the same space is sampled many times, with only small variations; for example when evaluating multiple pseudo-data sets.

About

Application to planetary science problems of the Metropolis-Hastings algorithm for Markov Chain Monte Carlo sampling of multidimensional spaces.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%