pocoMC
pocoMC: A Python package for accelerated Bayesian inference in astronomy and cosmology - Published in JOSS (2022)
Science Score: 95.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 1 DOI reference(s) in JOSS metadata -
○Academic publication links
-
✓Committers with academic emails
1 of 5 committers (20.0%) from academic institutions -
○Institutional organization owner
-
✓JOSS paper metadata
Published in Journal of Open Source Software
Keywords
Scientific Fields
Repository
pocoMC: A Python implementation of Preconditioned Monte Carlo for accelerated Bayesian Computation
Basic Info
- Host: GitHub
- Owner: minaskar
- License: gpl-3.0
- Language: Python
- Default Branch: main
- Homepage: https://pocomc.readthedocs.io
- Size: 28.3 MB
Statistics
- Stars: 104
- Watchers: 5
- Forks: 9
- Open Issues: 3
- Releases: 29
Topics
Metadata Files
README.md

pocoMC is a Python implementation of the Preconditioned Monte Carlo method for accelerated Bayesian inference
Getting started
Brief introduction
pocoMC is a Python package for fast Bayesian posterior and model evidence estimation. It leverages
the Preconditioned Monte Carlo (PMC) algorithm, offering significant speed improvements over
traditional methods like MCMC and Nested Sampling. Ideal for large-scale scientific problems
with expensive likelihood evaluations, non-linear correlations, and multimodality, pocoMC
provides efficient and scalable posterior sampling and model evidence estimation. Widely used
in cosmology and astronomy, pocoMC is user-friendly, flexible, and actively maintained.
Documentation
Read the docs at pocomc.readthedocs.io for more information, examples and tutorials.
Installation
To install pocomc using pip run:
bash
pip install pocomc
or, to install from source:
bash
git clone https://github.com/minaskar/pocomc.git
cd pocomc
python setup.py install
Basic example
For instance, if you wanted to draw samples from a 10-dimensional Rosenbrock distribution with a uniform prior, you would do something like:
```python import pocomc as pc import numpy as np from scipy.stats import uniform
n_dim = 10 # Number of dimensions
prior = pc.Prior(n_dim*[uniform(-10.0, 20.0)]) # U(-10,10)
def log_likelihood(x): return -np.sum(10.0(x[:,::2]2.0 - x[:,1::2])2.0 \ + (x[:,::2] - 1.0)*2.0, axis=1)
sampler = pc.Sampler( prior=prior, likelihood=log_likelihood, vectorize=True, ) sampler.run()
samples, weights, logl, logp = sampler.posterior() # Weighted posterior samples
logz, logz_err = sampler.evidence() # Bayesian model evidence estimate and uncertainty ```
Attribution & Citation
Please cite the following papers if you found this code useful in your research:
```bash @article{karamanis2022accelerating, title={Accelerating astronomical and cosmological inference with preconditioned Monte Carlo}, author={Karamanis, Minas and Beutler, Florian and Peacock, John A and Nabergoj, David and Seljak, Uro{\v{s}}}, journal={Monthly Notices of the Royal Astronomical Society}, volume={516}, number={2}, pages={1644--1653}, year={2022}, publisher={Oxford University Press} }
@article{karamanis2022pocomc, title={pocoMC: A Python package for accelerated Bayesian inference in astronomy and cosmology}, author={Karamanis, Minas and Nabergoj, David and Beutler, Florian and Peacock, John A and Seljak, Uros}, journal={arXiv preprint arXiv:2207.05660}, year={2022} } ```
Licence
Copyright 2022-Now Minas Karamanis and contributors.
pocoMC is free software made available under the GPL-3.0 License. For details see the LICENSE file.
Owner
- Name: Minas Karamanis
- Login: minaskar
- Kind: user
- Website: https://minaskaramanis.com
- Twitter: MinasKaramanis
- Repositories: 6
- Profile: https://github.com/minaskar
Postdoctoral Fellow at the Berkeley Center for Cosmological Physics, University of California, Berkeley
JOSS Publication
pocoMC: A Python package for accelerated Bayesian inference in astronomy and cosmology
Authors
Institute for Astronomy, University of Edinburgh, Royal Observatory, Blackford Hill, Edinburgh EH9 3HJ, UK, Physics Department, University of California and Lawrence Berkeley National Laboratory Berkeley, CA 94720, USA
Faculty of Computer and Information Science, University of Ljubljana, Ve\v{c}na pot 113, 1000 Ljubljana, Slovenia
Institute for Astronomy, University of Edinburgh, Royal Observatory, Blackford Hill, Edinburgh EH9 3HJ, UK
Tags
astronomyGitHub Events
Total
- Issues event: 2
- Watch event: 18
- Push event: 4
- Fork event: 1
- Create event: 3
Last Year
- Issues event: 2
- Watch event: 18
- Push event: 4
- Fork event: 1
- Create event: 3
Committers
Last synced: 5 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| minaskar | m****r@g****m | 158 |
| David Nabergoj | d****4@s****i | 99 |
| Dan F-M | f****y@g****m | 5 |
| joezuntz | j****z@g****m | 1 |
| Minas Karamanis | m****s@M****l | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 4 months ago
All Time
- Total issues: 15
- Total pull requests: 42
- Average time to close issues: 7 months
- Average time to close pull requests: 14 days
- Total issue authors: 10
- Total pull request authors: 6
- Average comments per issue: 2.07
- Average comments per pull request: 0.02
- Merged pull requests: 39
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 2
- Pull requests: 4
- Average time to close issues: N/A
- Average time to close pull requests: 5 minutes
- Issue authors: 2
- Pull request authors: 1
- Average comments per issue: 0.0
- Average comments per pull request: 0.0
- Merged pull requests: 4
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- ajdittmann (4)
- kazewong (3)
- LAujust (1)
- augeorge (1)
- kmzzhang (1)
- lindede249 (1)
- francois-rozet (1)
- marylou-gabrie (1)
- joezuntz (1)
- angelgarron (1)
Pull Request Authors
- minaskar (44)
- davidnabergoj (8)
- AlexKurek (2)
- dfm (2)
- augeorge (1)
- joezuntz (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 285 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 31
- Total maintainers: 1
pypi.org: pocomc
Preconditioned Monte Carlo
- Homepage: https://github.com/minaskar/pocomc
- Documentation: https://pocomc.readthedocs.io/
- License: GPLv3
-
Latest release: 1.2.6
published over 1 year ago
Rankings
Maintainers (1)
Dependencies
- myst_nb *
- sphinx_book_theme *
- corner *
- matplotlib *
- numpy *
- scipy *
- torch *
- tqdm *
- actions/checkout v2 composite
- actions/upload-artifact v1 composite
- openjournals/openjournals-draft-action master composite
- actions/checkout v2 composite
- actions/create-release v1 composite
- actions/setup-python v2 composite
- actions/upload-release-asset v1 composite
- pypa/gh-action-pypi-publish master composite
- actions/checkout v3 composite
- actions/setup-python v3 composite