NOTE: I recommend using my new GWMCMC sampler which can also be downloaded from the file exchange: http://www.mathworks.com/matlabcentral/fileexchange/49820-the-mcmc-hammer--gwmcmc
Markov Chain Monte Carlo sampling of posterior distribution
A metropolis sampler
initialm: starting point fopr random walk
loglikelihood: function handle to likelihood function: logL(m)
logprior: function handle to the log model priori probability: logPapriori(m)
stepfunction: function handle with no inputs which returns a random
step in the random walk. (note stepfunction can also be a
matrix describing the size of a normally distributed
mccount: How long should the markov chain be?
skip: Thin the chain by only storing every N'th step [default=10]
EXAMPLE USAGE: fit a normal distribution to data
logmodelprior=@(m)0; %use a flat prior.
m(1:100,:)=; %crop drift
--- Aslak Grinsted 2010
Aslak Grinsted (2021). Markov Chain Monte Carlo sampling of posterior distribution (https://www.mathworks.com/matlabcentral/fileexchange/47912-markov-chain-monte-carlo-sampling-of-posterior-distribution), MATLAB Central File Exchange. Retrieved .
hello. thanks for your submission. I need your help. I dont know initialm value for invese gamma distribution. please help me.
Hello Great code...but could you guide me if i have to define two uniform priors for mu and sigma or say two parameters of a distribution how can i do it in your code?
thanks so much for this amazing code!
Awesome code. Using it now!
@abdul: I don't understand your comment.
I did not get the same result
I just want to learn it！
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!