Metropolis Hastings
Version 1.0.0.0 (1.9 KB) by
Saad Jbabdi
Simple but powerful implementation of the MH algorithm
This is a very simple yet powerful implementation of the Metropolis Hastings algorithm. The function works a bit like Matlab's 'fmincon', but produces samples from the posterior distribution over parameters.
The algorithm assumes the following:
- Gaussian additive noise (variance is integrated out)
- Uniform priors over all parameters (this can easily be changed in the code)
Cite As
Saad Jbabdi (2024). Metropolis Hastings (https://www.mathworks.com/matlabcentral/fileexchange/41231-metropolis-hastings), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2009a
Compatible with any release
Platform Compatibility
Windows macOS LinuxCategories
Find more on Statistics and Machine Learning Toolbox in Help Center and MATLAB Answers
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Version | Published | Release Notes | |
---|---|---|---|
1.0.0.0 |