Chandra X-Ray Observatory (CXC)
Skip to the navigation links
Last modified: June 2012

URL: http://cxc.harvard.edu/sherpa/pyblocxs.html
Jump to: Description · Bugs


AHELP for CIAO 4.4 Sherpa v2

pyblocxs

Context: methods

Synopsis

MCMC-based algorithm for Bayesian Low-Count X-ray Spectral (BLoCXS) analysis

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 using a predefined Sherpa model to high-energy X-ray spectral data.

The Sherpa get_draws() function runs a pyBLoCXS chain using fit information associated with the specified data set(s), and the currently set sampler (either Metropolis-Hastings, a mix of Metropolis with Metropolis-Hastings, or PragBayes) and parameter priors, for a specified number of iterations. It returns an array of statistic values, an array of acceptance Booleans, and a 2-D array of associated parameter values.

The sampler, or jumping rule, to be used by pyBLoCXS may be set with set_sampler(), and its configuration options modifed using the set_sampler_opt() fuction. The available samplers - "MH", "MetropolisMH", and "PragBayes" - are returned by the list_samplers() command ("ahelp list_samplers"). "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.)

By default, pyBLoCXS uses a flat prior defined between the hardcoded parameter minima and maxima. The set_prior() function is used to associate a function or model ('prior') with a thawed fit parameter ('par'). The function signature for 'prior' is of the form lambda x, and can be a Sherpa model or an arbitrary user-defined function.

The list of currently set prior-parameter pairs is returned by the list_priors command (). The prior function associated with a particular Sherpa model parameter may be accessed with get_prior ("ahelp get_prior").

Refer to the pyBLoCXS documentation for additional information about the algorithm.

Bugs

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


Last modified: June 2012
CXC logo

The Chandra X-Ray Center (CXC) is operated for NASA by the Smithsonian Astrophysical Observatory. 60 Garden Street, Cambridge, MA 02138 USA.   Email: cxcweb@head.cfa.harvard.edu Smithsonian Institution, Copyright © 1998-2012. All rights reserved.