The extended Metropolis algorithm is in general a much more efficient algorithm for sampling the a posteriori probability
The extended Metropolis sampler can be run using
options.mcmc.nite=40000; % number of iterations, default nite=30000 options.mcmc.i_sample=50; % save the current model for every 50 iterations, default, i_sample=500 options.mcmc.i_plot=1000; % plot progress of the Metropolis sampler for every 100 iterations % default i_plot=50; options.txt='case_line_fit'; % descriptive name appended to output folder name, default txt=''; [options,data,prior,forward,m_current]=sippi_metropolis(data,prior,forward,options)
One can choose to accept all steps in the Metropolis sampler, which will result in an algorithm sampling the prior model, using
options.mcmc.accept_all=1; % default [0]
One can choose to accept models that lead to an improvement in the likelihood, which results in an optimization like algorithm using
options.mcmc.accept_only_improvements=1; % default [0]
See sippi_metropolis for more details.
One optionally, as part of running the extended Metropolis sampler, automatically update the 'step'-length of the sequential Gibbs sampler in order to ensure a specific approximate acceptance ratio of the Metropolis sampler. See [CHM12] for details.
The default parameters for adjusting the step length, as given below, are set in the 'prior.seq_gibbs' structure. These parameters will be set the first time 'sippi_prior' is called with the 'prior' structure as output.The default parameters.
prior{m}.seq_gibbs.step_min=0; prior{m}.seq_gibbs.step_min=1; prior{m}.seq_gibbs.i_update_step=50 prior{m}.seq_gibbs.i_update_step_max=1000 prior{m}.seq_gibbs.n_update_history=50 prior{m}.seq_gibbs.P_target=0.3000
By default, adjustment of the step length, in order to achieve an acceptance ratio of 0.3 ('prior{m}.seq_gibbs.P_target'), will be performed for every 50 ('prior{m}.seq_gibbs.i_update_step') iterations, using the acceptance ratio observed in the last 50 ('prior{m}.seq_gibbs.i_update_history') iterations.
Adjustment of the step length will be performed only in the first 1000 ('prior{m}.seq_gibbs.i_update_step_max') iterations.
In order to disable automatic adjustment of the step length simply set
prior{m}.seq_gibbs.i_update_step_max=0; % disable automatic step length
This site is hosted by sourceforge.net |