{"id":20235733,"url":"https://github.com/minaskar/pocomc","last_synced_at":"2025-04-04T12:09:25.813Z","repository":{"id":41288644,"uuid":"454769355","full_name":"minaskar/pocomc","owner":"minaskar","description":"pocoMC: A Python implementation of Preconditioned Monte Carlo for accelerated Bayesian Computation","archived":false,"fork":false,"pushed_at":"2025-02-06T15:25:24.000Z","size":29669,"stargazers_count":98,"open_issues_count":1,"forks_count":8,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-28T11:09:49.672Z","etag":null,"topics":["astronomy","astrophysics","bayesian-inference","black-box-bayesian-inference","cosmology","cosmology-inference","general-purpose","inference","machine-learning","mcmc","mcmc-sampler","normalizing-flows","probabilistic-data-analysis","python","sampling","sampling-methods","smc"],"latest_commit_sha":null,"homepage":"https://pocomc.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/minaskar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-02T12:40:14.000Z","updated_at":"2025-03-27T00:02:31.000Z","dependencies_parsed_at":"2024-08-27T09:29:38.476Z","dependency_job_id":"55bdcc98-ab4a-4c95-96f5-61dbafc2d380","html_url":"https://github.com/minaskar/pocomc","commit_stats":null,"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minaskar%2Fpocomc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minaskar%2Fpocomc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minaskar%2Fpocomc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minaskar%2Fpocomc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/minaskar","download_url":"https://codeload.github.com/minaskar/pocomc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247174454,"owners_count":20896078,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["astronomy","astrophysics","bayesian-inference","black-box-bayesian-inference","cosmology","cosmology-inference","general-purpose","inference","machine-learning","mcmc","mcmc-sampler","normalizing-flows","probabilistic-data-analysis","python","sampling","sampling-methods","smc"],"created_at":"2024-11-14T08:17:35.500Z","updated_at":"2025-04-04T12:09:25.792Z","avatar_url":"https://github.com/minaskar.png","language":"Python","readme":"![logo](logo.png)\n\n**pocoMC is a Python implementation of the Preconditioned Monte Carlo method for accelerated Bayesian inference**\n\n[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://github.com/minaskar/pocomc/blob/master/LICENSE)\n[![Documentation Status](https://readthedocs.org/projects/pocomc/badge/?version=latest)](https://pocomc.readthedocs.io/en/latest/?badge=latest)\n\n\n# Getting started\n\n## Brief introduction\n\n``pocoMC`` is a Python package for fast Bayesian posterior and model evidence estimation. It leverages \nthe Preconditioned Monte Carlo (PMC) algorithm, offering significant speed improvements over \ntraditional methods like MCMC and Nested Sampling. Ideal for large-scale scientific problems \nwith expensive likelihood evaluations, non-linear correlations, and multimodality, ``pocoMC`` \nprovides efficient and scalable posterior sampling and model evidence estimation. Widely used \nin cosmology and astronomy, ``pocoMC`` is user-friendly, flexible, and actively maintained.\n\n## Documentation\n\nRead the docs at [pocomc.readthedocs.io](https://pocomc.readthedocs.io) for more information, examples and tutorials.\n\n## Installation\n\nTo install ``pocomc`` using ``pip`` run:\n\n```bash\npip install pocomc\n```\n\nor, to install from source:\n\n```bash\ngit clone https://github.com/minaskar/pocomc.git\ncd pocomc\npython setup.py install\n```\n\n## Basic example\n\nFor instance, if you wanted to draw samples from a 10-dimensional Rosenbrock distribution with a uniform prior, you would do something like:\n\n```python\nimport pocomc as pc\nimport numpy as np\nfrom scipy.stats import uniform\n\nn_dim = 10  # Number of dimensions\n\nprior = pc.Prior(n_dim*[uniform(-10.0, 20.0)]) # U(-10,10)\n\ndef log_likelihood(x):\n    return -np.sum(10.0*(x[:,::2]**2.0 - x[:,1::2])**2.0 \\\n            + (x[:,::2] - 1.0)**2.0, axis=1)\n\nsampler = pc.Sampler(\n    prior=prior,\n    likelihood=log_likelihood,\n    vectorize=True,\n)\nsampler.run()\n\nsamples, weights, logl, logp = sampler.posterior() # Weighted posterior samples\n\nlogz, logz_err = sampler.evidence() # Bayesian model evidence estimate and uncertainty\n```\n\n\n# Attribution \u0026 Citation\n\nPlease cite the following papers if you found this code useful in your research:\n\n```bash\n@article{karamanis2022accelerating,\n    title={Accelerating astronomical and cosmological inference with preconditioned Monte Carlo},\n    author={Karamanis, Minas and Beutler, Florian and Peacock, John A and Nabergoj, David and Seljak, Uro{\\v{s}}},\n    journal={Monthly Notices of the Royal Astronomical Society},\n    volume={516},\n    number={2},\n    pages={1644--1653},\n    year={2022},\n    publisher={Oxford University Press}\n}\n\n@article{karamanis2022pocomc,\n    title={pocoMC: A Python package for accelerated Bayesian inference in astronomy and cosmology},\n    author={Karamanis, Minas and Nabergoj, David and Beutler, Florian and Peacock, John A and Seljak, Uros},\n    journal={arXiv preprint arXiv:2207.05660},\n    year={2022}\n}\n```\n\n# Licence\n\nCopyright 2022-Now Minas Karamanis and contributors.\n\n``pocoMC`` is free software made available under the GPL-3.0 License. For details see the `LICENSE` file.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminaskar%2Fpocomc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fminaskar%2Fpocomc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminaskar%2Fpocomc/lists"}