You are now following this Submission
- You will see updates in your followed content feed
- You may receive emails, depending on your communication preferences
Easy algorithm to generate a Metropolis-Hastings Monte Carlo Markov chain that, given a probability density function (pdf), generate a Markow chain. The function enables the user to select the pdf, using a function handler @(x), and it enables to choose a sampler between uniform and gaussian. The example code also shows how to plot the Markow process just generated and it enables to convert the process into a cool video where you can follow the behaviour of your MCMC.
Make sure to read the comments inside the functions.
Cite As
Eugenio Bertolini (2026). Metropolis-Hastings Monte Carlo Markov chain algorithm (https://www.mathworks.com/matlabcentral/fileexchange/78017-metropolis-hastings-monte-carlo-markov-chain-algorithm), MATLAB Central File Exchange. Retrieved .
General Information
- Version 1.0.1 (5.38 MB)
MATLAB Release Compatibility
- Compatible with R2019b and later releases
Platform Compatibility
- Windows
- macOS
- Linux
