PyMCMC allows users to sample from probability distributions of interest using various Markov Chain Monte Carlo methods.
To install PyMCMC, follow these steps:
pip install pip@git+https://github.com/mjcarter95/PyMCMC.git
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()
To contribute to PyMCMC, follow these steps:
- Fork this repository.
- Create a branch:
git checkout -b <branch_name>
. - Make your changes and commit them:
git commit -m '<commit_message>'
- Push to the original branch:
git push origin <project_name>/<location>
- Create the pull request.
Alternatively see the GitHub documentation on creating a pull request.
Thanks to the following people who have contributed to this project:
If you want to contact me you can reach me at <m (dot) j (dot) carter (at) liverpool (dot) ac (dot) uk>.
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}
}
The University of Liverpool and IBM Research for co-funding the EPSRC CDT in Distributed Algorithms doctoral project titled Uncertain Heterogeneous Algorithmic Teamwork