set_sampler
- sherpa.ui.set_sampler(sampler)
Set the MCMC sampler.
The sampler determines the type of jumping rule to be used when running the MCMC analysis.
- Parameters:
sampler (str or
sherpa.sim.Samplerinstance) – When a string, the name of the sampler to use (case insensitive). The supported options are given by thelist_samplersfunction.
See also
get_drawsRun the pyBLoCXS MCMC algorithm.
list_samplersList the MCMC samplers.
set_samplerSet the MCMC sampler.
set_sampler_optSet an option for the current MCMC sampler.
Notes
The jumping rules are:
- MH
The Metropolis-Hastings rule, which jumps from the best-fit location, even if the previous iteration had moved away from it.
- MetropolisMH
This is the Metropolis with Metropolis-Hastings algorithm, that jumps from the best-fit with probability
p_M, otherwise it jumps from the last accepted jump. The value ofp_Mcan be changed usingset_sampler_opt.- PragBayes
This is used when the effective area calibration uncertainty is to be included in the calculation. At each nominal MCMC iteration, a new calibration product is generated, and a series of N (the
nsubitersoption) MCMC sub-iteration steps are carried out, choosing between Metropolis and Metropolis-Hastings types of samplers with probabilityp_M. Only the last of these sub-iterations are kept in the chain. Thensubitersandp_Mvalues can be changed usingset_sampler_opt.- FullBayes
Another sampler for use when including uncertainties due to the effective area.
Examples
>>> set_sampler('metropolismh')