From 53f027915b212e14c4d04a123580bf059245484f Mon Sep 17 00:00:00 2001 From: Jakob Robnik <43053552+JakobRobnik@users.noreply.github.com> Date: Fri, 1 Dec 2023 21:49:11 +0100 Subject: [PATCH 1/4] adding FAQ to README --- README.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 062c370..f1ec426 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,6 @@ You can check out the tutorials: - [getting started](notebooks/tutorials/intro_tutorial.ipynb): sampling from a standard Gaussian - [advanced tutorial](notebooks/tutorials/advanced_tutorial.ipynb): sampling the hierarchical Stochastic Volatility model for the S&P500 returns data -- [constraints](notebooks/tutorials/Constraints.ipynb) Julia implementation is available [here](https://github.com/JaimeRZP/MicroCanonicalHMC.jl). @@ -23,4 +22,19 @@ The associated papers are: The code is still in active development, so let us know if you encounter any issues, including bad sampling performance, and we will do our best to help you out. You can submit a github issue or contact us at jakob_robnik@berkeley.edu . +##Some common misconceptions and frequently asked questions: + +###How can I sample with MCHMC if my parameters have bounds? +Check out [this tutorial](notebooks/tutorials/Constraints.ipynb). + +###How does cost of producing one sample in HMC compare to the cost of one sample in MCHMC? +MCHMC samples are less costly. What is relevant for the computational time is the number of gradient evaluations used. Each sample in MCHMC is two gradient evaluations (1 gradient evaluation if leapfrog integrator is used instead of minimal norm integrator). Each sample in HMC is L gradient evaluations (where L is the number of leapfrog steps per sample), which can be quite large for hard targets (in default NUTS setting up to 1024). + +###Is MCHMC just some weird projection of HMC onto the constant energy surface? +No, the Hamiltonian dynamics of both methods are different (the particles move differently). + + + + + ![ensamble](img/rosenbrock.gif) From f096d111f9fbfae122ffb077faca3b7ef84eeb6d Mon Sep 17 00:00:00 2001 From: Jakob Robnik <43053552+JakobRobnik@users.noreply.github.com> Date: Fri, 1 Dec 2023 21:49:42 +0100 Subject: [PATCH 2/4] Update README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f1ec426..4b181ed 100644 --- a/README.md +++ b/README.md @@ -22,15 +22,15 @@ The associated papers are: The code is still in active development, so let us know if you encounter any issues, including bad sampling performance, and we will do our best to help you out. You can submit a github issue or contact us at jakob_robnik@berkeley.edu . -##Some common misconceptions and frequently asked questions: +## Some common misconceptions and frequently asked questions: -###How can I sample with MCHMC if my parameters have bounds? +### How can I sample with MCHMC if my parameters have bounds? Check out [this tutorial](notebooks/tutorials/Constraints.ipynb). -###How does cost of producing one sample in HMC compare to the cost of one sample in MCHMC? +### How does cost of producing one sample in HMC compare to the cost of one sample in MCHMC? MCHMC samples are less costly. What is relevant for the computational time is the number of gradient evaluations used. Each sample in MCHMC is two gradient evaluations (1 gradient evaluation if leapfrog integrator is used instead of minimal norm integrator). Each sample in HMC is L gradient evaluations (where L is the number of leapfrog steps per sample), which can be quite large for hard targets (in default NUTS setting up to 1024). -###Is MCHMC just some weird projection of HMC onto the constant energy surface? +### Is MCHMC just some weird projection of HMC onto the constant energy surface? No, the Hamiltonian dynamics of both methods are different (the particles move differently). From 2f652bd8463088bf4d706d247a697200ddf37a30 Mon Sep 17 00:00:00 2001 From: Jakob Robnik <43053552+JakobRobnik@users.noreply.github.com> Date: Fri, 1 Dec 2023 21:51:07 +0100 Subject: [PATCH 3/4] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4b181ed..e85b15e 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ Check out [this tutorial](notebooks/tutorials/Constraints.ipynb). MCHMC samples are less costly. What is relevant for the computational time is the number of gradient evaluations used. Each sample in MCHMC is two gradient evaluations (1 gradient evaluation if leapfrog integrator is used instead of minimal norm integrator). Each sample in HMC is L gradient evaluations (where L is the number of leapfrog steps per sample), which can be quite large for hard targets (in default NUTS setting up to 1024). ### Is MCHMC just some weird projection of HMC onto the constant energy surface? -No, the Hamiltonian dynamics of both methods are different (the particles move differently). +No, the Hamiltonian dynamics of both methods are different (the particles move differently). Below is the motion of MCHMC particles for the Rosenbrock target distribution. From 7a49a8f17c7c33a32c09044cb608ea120fac3921 Mon Sep 17 00:00:00 2001 From: Jakob Robnik <43053552+JakobRobnik@users.noreply.github.com> Date: Fri, 1 Dec 2023 21:52:58 +0100 Subject: [PATCH 4/4] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e85b15e..4002a21 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ The associated papers are: The code is still in active development, so let us know if you encounter any issues, including bad sampling performance, and we will do our best to help you out. You can submit a github issue or contact us at jakob_robnik@berkeley.edu . -## Some common misconceptions and frequently asked questions: +## Frequently asked questions: ### How can I sample with MCHMC if my parameters have bounds? Check out [this tutorial](notebooks/tutorials/Constraints.ipynb).