{"id":13477295,"url":"https://github.com/thiery-lab/manifold-mcmc-for-diffusions","last_synced_at":"2025-03-27T05:31:21.987Z","repository":{"id":37653775,"uuid":"225546103","full_name":"thiery-lab/manifold-mcmc-for-diffusions","owner":"thiery-lab","description":"Code accompanying the paper 'Manifold MCMC methods for Bayesian inference in a wide class of diffusion models'","archived":false,"fork":false,"pushed_at":"2023-08-11T10:55:56.000Z","size":12541,"stargazers_count":10,"open_issues_count":1,"forks_count":3,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-10-30T10:40:11.809Z","etag":null,"topics":["diffusions","hmc","mcmc","sde"],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thiery-lab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-12-03T06:21:00.000Z","updated_at":"2024-10-12T11:35:08.000Z","dependencies_parsed_at":"2022-09-04T20:13:55.841Z","dependency_job_id":"16aefeb2-b974-4b3b-a9d9-2d37046552aa","html_url":"https://github.com/thiery-lab/manifold-mcmc-for-diffusions","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiery-lab%2Fmanifold-mcmc-for-diffusions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiery-lab%2Fmanifold-mcmc-for-diffusions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiery-lab%2Fmanifold-mcmc-for-diffusions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiery-lab%2Fmanifold-mcmc-for-diffusions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thiery-lab","download_url":"https://codeload.github.com/thiery-lab/manifold-mcmc-for-diffusions/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245791477,"owners_count":20672665,"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":["diffusions","hmc","mcmc","sde"],"created_at":"2024-07-31T16:01:40.693Z","updated_at":"2025-03-27T05:31:21.323Z","avatar_url":"https://github.com/thiery-lab.png","language":"Jupyter Notebook","funding_links":[],"categories":["Jupyter Notebook"],"sub_categories":[],"readme":" # Manifold MCMC methods for inference in diffusion models\n\n [![DOI](https://zenodo.org/badge/225546103.svg)](https://zenodo.org/badge/latestdoi/225546103)\n\nCode accompanying the paper [*Manifold Markov chain Monte Carlo methods for Bayesian inference in a wide class of diffusion models*](https://arxiv.org/abs/1912.02982).\n\nThe manifold Markov chain Monte Carlo (MCMC) methods in [Mici](https://github.com/matt-graham/mici) are used for inference, with the `sde` package in this repository adding helper functions and classes specific to performing inference in stochastic differential equation (SDE) models, in particular diffusion processes. The numerical integrators for SDE systems in `sde.integrators` and example models in `sde.example_models` use [SymNum](https://github.com/matt-graham/symnum) to automatically construct derivatives of model specific functions. [JAX](https://github.com/google/jax) is used to generate efficient just-in-time compiled functions for numerically integrating the diffusion models and evaluating the derivatives required for performing MCMC inference.\n\n## Installation\n\nThe `sde` package requires Python 3.7 or above. To install the `sde` package and its dependencies in the current Python environment run\n\n```bash\npip install git+https://github.com/thiery-lab/manifold-mcmc-for-diffusions.git\n```\n\nTo install the package and all dependencies required to run the [scripts for reproducing the experiments in the paper](#experiment-scripts) run\n\n```bash\npip install git+https://github.com/thiery-lab/manifold-mcmc-for-diffusions.git#egg=sde\\[scripts\\]\n```\n\nTo install the package and all dependencies required to run [the example Jupyter notebook](#example-notebook) run\n\n\n```bash\npip install git+https://github.com/thiery-lab/manifold-mcmc-for-diffusions.git#egg=sde\\[notebook\\]\n```\n\n\n## Experiment scripts\n\nA number of scripts for reproducing the numerical experiments used to produce the figures in the paper are provided in the `scripts` directory. To run these scripts the `sde` package, its dependencies and the additional dependencies required to run the scripts need to be installed in the local Python environment [as described above](#installation).\n\nFor the experiments with the FitzHugh\u0026ndash;Nagumo model with noisy observations, the MCMC algorithm implemented in the Julia [BridgeSDEInference](https://github.com/mmider/BridgeSDEInference.jl) package is also used for comparison. A local Julia installation (tested with version 1.6) is therefore also required to run these experiments. The required Julia dependencies can be installed from a Julia REPL by running\n\n```Julia\nimport Pkg\nPkg.add([\"ArgParse\", \"BridgeSDEInference\", \"JSON\", \"NPZ\", \"PyCall\"])\n```\n\nThere are Python scripts for running individual experiments with each model and inference algorithm combination, as well as Python scripts for generating plots from the results for each model. A description of what a particular script does, what arguments can be passed and what their default values are can be displayed by running\n\n```bash\npython path/to/script.py --help\n```\n\nThere are also bash scripts provided for running the full set of experiments used to produce the figures in the paper. As a warning, these scripts sequentially run experiments over grids of different variables and in some cases for multiple different pseudo-random seeds, and so running all these scripts should be expected to take several days to complete. As some of the plotted values are dependent on computation times which is affected among other things by the system being run on, the generated plots will not exactly match those in the paper.\n\n\n## Example notebook\n\nA complete example of applying the method described in the paper to perform inference in a Fitzhugh-Nagumo hypoelliptic diffusion model with accompanying explanatory notes is provided in the Jupyter notebook [`FitzHugh-Nagumo_example.ipynb`](FitzHugh-Nagumo_example.ipynb) . This notebook can also be viewed or run interactively online using the links below.\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003cth colspan=\"2\"\u003e\u003cimg src='https://raw.githubusercontent.com/jupyter/design/master/logos/Favicon/favicon.svg?sanitize=true' width=\"15\" style=\"vertical-align:text-bottom; margin-right: 5px;\"/\u003e FitzHugh-Nagumo_example.ipynb\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eOpen non-interactive version with nbviewer\u003c/td\u003e\n    \u003ctd\u003e\n      \u003ca href=\"https://nbviewer.jupyter.org/github/thiery-lab/manifold-mcmc-for-diffusions/blob/master/FitzHugh-Nagumo_example.ipynb\"\u003e\n        \u003cimg src=\"https://raw.githubusercontent.com/jupyter/design/master/logos/Badges/nbviewer_badge.svg?sanitize=true\" width=\"109\" alt=\"Render with nbviewer\"  style=\"vertical-align:text-bottom\" /\u003e\n      \u003c/a\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eOpen interactive version with Binder\u003c/td\u003e\n    \u003ctd\u003e\n      \u003ca href=\"https://mybinder.org/v2/gh/thiery-lab/manifold-mcmc-for-diffusions/master?filepath=FitzHugh-Nagumo_example.ipynb\"\u003e\n        \u003cimg src=\"https://mybinder.org/badge_logo.svg\" alt=\"Launch with Binder\"  style=\"vertical-align:text-bottom\"/\u003e\n      \u003c/a\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eOpen interactive version with Google Colab\u003c/td\u003e\n    \u003ctd\u003e\n      \u003ca href=\"https://colab.research.google.com/github/thiery-lab/manifold-mcmc-for-diffusions/blob/master/FitzHugh-Nagumo_example.ipynb\"\u003e\n        \u003cimg alt=\"Open in Colab\" src=\"https://colab.research.google.com/assets/colab-badge.svg\" style=\"vertical-align:text-bottom\"\u003e\n       \u003c/a\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n## Citation\n\nTo cite the pre-print the following `bibtex` entry can be used\n\n```bibtex\n@article{graham2019manifold,\n  author={Graham, Matthew M. and Thiery, Alexandre H. and Beskos, Alexandros},\n  title={Manifold Markov chain Monte Carlo methods for Bayesian inference in a wide class of diffusion models},\n  year={2019},\n  journal={Pre-print arxiv:1912.02982},\n  url={https://arxiv.org/abs/1912.02982}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthiery-lab%2Fmanifold-mcmc-for-diffusions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthiery-lab%2Fmanifold-mcmc-for-diffusions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthiery-lab%2Fmanifold-mcmc-for-diffusions/lists"}