Multi-Parameter Bayesian Inference Using Markov Chain Monte Carlo (MCMC) Sampling and the Metropolis-Hastings Algorithm
There are two (similar) versions, one in Python and one in C++:
-
Wikipedia, "Metropolis-Hastings Algorithm".
-
Wikipedia, "Markov Chain Monte Carlo".
-
"Bayesian Statistics", Chapter 2 in "Advanced Algorithmic Trading", by M. Halls-Moore.
-
Probabilistic programming in Python using pymc3.
-
The Python version has one example more than the C++ version (Coin_upd).
-
The differences in the results between the two versions are mostly due to the randomly generated initial data (array
data
). To compare solutions, simply generate and save the data using one of the versions and then load them in the other version. -
The remaining (very) small differences are due to the randomness implicit in the Metropolis-Hastings algorithm.