Skip to content

A collection of MCMC methods in Python using Numpy and Scipy

License

Notifications You must be signed in to change notification settings

mjcarter95/PyMCMC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyMCMC

A collection of MCMC methods in Python using Numpy and Scipy

GitHub repo size GitHub contributors GitHub stars GitHub forks Twitter Follow

PyMCMC allows users to sample from probability distributions of interest using various Markov Chain Monte Carlo methods.

Installing PyMCMC

To install PyMCMC, follow these steps:

pip install pip@git+https://github.com/mjcarter95/PyMCMC.git

Using PyMCMC

A number of example problems are provided in the examples folder.

Example: A single Metropolis-Hastings chain can be applied to a user-defined target density as follows

    target = Target()

    sample_proposal = multivariate_normal(mean=np.zeros(target.dim), cov=np.eye(target.dim))
    momentum_proposal = multivariate_normal(mean=np.zeros(target.dim), cov=np.eye(target.dim))

    rw_mcmc = MCMCSampler(
        K=K,
        dim=target.dim,
        target=target,
        forward_kernel=forward_kernel,
        sample_proposal=sample_proposal,
    )

    rw_mcmc.sample()

Contributing to PyMCMC

To contribute to PyMCMC, follow these steps:

  1. Fork this repository.
  2. Create a branch: git checkout -b <branch_name>.
  3. Make your changes and commit them: git commit -m '<commit_message>'
  4. Push to the original branch: git push origin <project_name>/<location>
  5. Create the pull request.

Alternatively see the GitHub documentation on creating a pull request.

Contributors

Thanks to the following people who have contributed to this project:

Contact

If you want to contact me you can reach me at <m (dot) j (dot) carter (at) liverpool (dot) ac (dot) uk>.

Citation

We appreciate citations as they let us discover what people have been doing with the software.

To cite PyMCMC in publications use:

Carter, M. (2023). PyMCMC (1.0.0). https://github.com/mjcarter95/PyMCMC

Or use the following BibTeX entry:

@misc{pymcmc,
  title = {PyMCMC (1.0.0)},
  author = {Carter, Matthew},
  year = {2023},
  month = may,
  howpublished = {GitHub},
  url = {https://github.com/mjcarter95/PyMCMC}
}

Acknowledgements

The University of Liverpool and IBM Research for co-funding the EPSRC CDT in Distributed Algorithms doctoral project titled Uncertain Heterogeneous Algorithmic Teamwork

About

A collection of MCMC methods in Python using Numpy and Scipy

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages