Last modified: December 2023

URL: https://cxc.cfa.harvard.edu/sherpa/ahelp/set_sampler.html
Jump to: Description · Example · PARAMETERS · Notes · Bugs · See Also


AHELP for CIAO 4.16 Sherpa

set_sampler

Context: statistics

Synopsis

Set the MCMC sampler.

Syntax

set_sampler(sampler)

sampler - str or `sherpa.sim.Sampler` instance

Description

The sampler determines the type of jumping rule to be used when running the MCMC analysis.


Example

>>> set_sampler('metropolismh')

PARAMETERS

The parameter for this function is:

Parameter Definition
sampler When a string, the name of the sampler to use (case insensitive). The supported options are given by the `list_samplers` function.

Notes

The jumping rules are:

Item Definition
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 of p_m can be changed using `set_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 nsubiters option) MCMC sub-iteration steps are carried out, choosing between Metropolis and Metropolis-Hastings types of samplers with probability p_m . Only the last of these sub-iterations are kept in the chain. The nsubiters and p_m values can be changed using `set_sampler_opt` .
FullBayes Another sampler for use when including uncertainties due to the effective area.

Bugs

See the bugs pages on the Sherpa website for an up-to-date listing of known bugs.

See Also

confidence
set_conf_opt, set_covar_opt, set_proj_opt
data
set_areascal, set_arf, set_backscal, set_bkg, set_coord, set_counts, set_data, set_dep, set_exposure, set_grouping, set_quality, set_rmf, set_staterror, set_syserror
filtering
set_filter
info
list_stats
methods
get_draws, set_iter_method, set_iter_method_opt, set_method, set_method_opt
modeling
get_par, get_xsabund, get_xscosmo, get_xsxsect, get_xsxset, set_bkg_model, set_bkg_source, set_full_model, set_model, set_par, set_pileup_model, set_source, set_xsabund, set_xscosmo, set_xsxsect, set_xsxset
statistics
cash, chi2constvar, chi2datavar, chi2gehrels, chi2modvar, chi2xspecvar, chisquare, cstat, get_prior, leastsq, list_priors, set_prior, set_sampler_opt, set_stat, wstat
utilities
set_analysis, set_default_id
visualization
image_setregion