Synopsis
Return information on the current pyBLoCXS sampler.
Syntax
get_sampler() get_sampler_opt( [optname] ) get_sampler_name()
Description
pyBLoCXS is a sophisticated Markov chain Monte Carlo (MCMC) based algorithm designed to carry out Bayesian Low-Count X-ray Spectral (BLoCXS) analysis in the Sherpa environment. The algorithm explores parameter space at a suspected minimum - i.e. after a standard Sherpa fit.
The Sherpa get_sampler commands return information about the type of jumping rule used in MCMC.
Jumping Rules
"MH" is Metropolis-Hastings, which always jumps from the best-fit, and "MetropolisMH" is Metropolis with Metropolis-Hastings that jumps from the best-fit with probability 'p_M', else it jumps from the last accepted jump. "PragBayes" is used when 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 (option in set_sampler_opt) MCMC sub-iteration steps are carried out, choosing between Metropolis and Metropolis-Hastings types of samplers with probability p_M (option in set_sampler_opt). Only the last of these sub-iterations are kept in the chain.)
- get_sampler - access configuration options for the current sampler
- get_sampler_opt - access a particular sampler option for a pyBLoCXS chain
- get_sampler_name - access the current sampler name
The configuration options returned by get_sampler include the following:
Metropolis-Hastings Jumping Rule
- defaultprior - Boolean to indicate that all parameters have the default flat prior.
- inv - Boolean or array of booleans indicating which parameters are on the inverse scale.
- log - Boolean or array of booleans indicating which parameters are on the logarithm scale (natural log).
- originalscale - Array of booleans indicating which parameters are on the original scale.
- priorshape - Array of booleans indicating which parameters have associated user-defined prior functions.
- scale - A scalar multiple of the output of covar() used in the scale of the t-distribution.
Mixture of Metropolis and Metropolis-Hastings Jumping Rules
- defaultprior - Boolean to indicate that all parameters have the default flat prior.
- inv - Boolean or array of booleans indicating which parameters are on the inverse scale.
- log - Boolean or array of booleans indicating which parameters are on the logarithm scale (natural log).
- originalscale - Array of booleans indicating which parameters are on the original scale.
- p_M - The proportion of jumps generated by the Metropolis jumping rule.
- priorshape - Array of booleans indicating which parameters have associated user-defined prior functions.
- scale - A scalar multiple of the output of covar() used in the scale of the t-distribution.
Available samplers are returned by the list_samplers command.
Refer to the pyBLoCXS documentation for additional information about the algorithm.
Examples
Example 1
sherpa> print get_sampler_name()
Return the name of the current sampler. In this example, it is the default "MetropolisMH" for Metropolis withnMetropolis-Hastings.
sherpa> load_pha("pha.fits") sherpa> set_source(xsphabs.abs1 * powlaw1d.p1) sherpa> set_stat("cash") sherpa> fit() sherpa> covar() sherpa> print get_sampler_name() MetropolisMH
Example 2
sherpa> print get_sampler()
Retrieve the configuration options for the current sampler. The output for this example is:
"{'priorshape': False, 'scale': 1, 'log': False, 'defaultprior': True, 'inv': False, 'sigma_m': False, 'priors': (), 'originalscale': True, 'verbose': False}"
Example 3
sherpa> get_sampler_opt('log')
Return the current setting for the 'log' configuration option of the current sampler.
sherpa> get_sampler_opt('log') False
Bugs
See the bugs pages on the Sherpa website for an up-to-date listing of known bugs.
See Also
- confidence
- get_conf, get_covar, get_int_proj, get_int_unc, get_proj, get_reg_proj, get_reg_unc
- contrib
- get_chart_spectrum, get_marx_spectrum
- data
- get_areascal, get_arf, get_arf_plot, get_axes, get_backscal, get_bkg, get_bkg_plot, get_bkg_scale, get_coord, get_counts, get_data, get_data_plot, get_dep, get_dims, get_error, get_exposure, get_grouping, get_indep, get_quality, get_rmf, get_specresp, get_staterror, get_syserror
- filtering
- get_filter
- fitting
- calc_stat_info, get_fit, get_stat_info
- info
- get_default_id, list_stats
- methods
- get_draws, get_iter_method_name, get_iter_method_opt, get_method
- modeling
- get_model, get_model_component, get_model_component_image, get_model_component_plot, get_model_plot, get_num_par, get_order_plot, get_par, get_pileup_model, get_response, get_source, get_source_component_image, get_source_component_plot, image_source
- plotting
- get_split_plot
- psfs
- get_kernel, get_psf
- statistics
- get_chisqr_plot, get_delchi_plot, get_prior, get_stat
- utilities
- get_analysis, get_rate
- visualization
- get_ratio, get_resid, image_getregion