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

URL: http://cxc.harvard.edu/sherpa/ahelp/list_priors.html
Jump to: Description · Example · Bugs · See Also


AHELP for CIAO 4.9 Sherpa v1

list_priors

Context: statistics

Synopsis

List thawed Sherpa model parameters with associated priors.

Syntax

list_priors()

Description

The Sherpa prior functions constitute a subset of the pyBLoCXS suite of functions; 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.

By default, pyBLoCXS uses a flat prior defined between the hardcoded parameter minima and maxima. The list_priors() function may be used to return the list of all currently associated parameter-prior pairs, which have been set using the set_prior() function (see 'ahelp set_prior'). The get_prior() function accesses the name of the prior function ('prior') which has been assigned to a particular thawed fit parameter ('par').

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

Example

print list_priors()

Call the list_priors() function with no arguments to return the dictionary of currently set prior functions for the set of thawed Sherpa model parameters.

sherpa> normgauss1d.g1
sherpa> xsapec.therm
sherpa> g1.pos=2.5; g1.fwhm=0.5
sherpa> set_prior(therm.kT,g1)

sherpa> def lognorm(x, sigma=0.5, norm=1.0, x0=20.):
   xl=numpy.log10(x)+22.
   return (norm/numpy.sqrt(2*numpy.pi)/sigma)*numpy.exp(-0.5*(xl-x0)*(xl-x0)/sigma/sigma)

sherpa> set_prior(abs1.nH,lognorm)

sherpa> print list_priors()
{'therm.kT': <NormGauss1D model instance 'normgauss1d.g1'>, 'abs1.nH': <function lognorm at 0xc857230>}

Bugs

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

See Also

info
list_functions, list_response_ids, list_stats
methods
list_iter_methods, list_methods
models
list_model_components, list_models
statistics
cash, chi2constvar, chi2datavar, chi2gehrels, chi2modvar, chi2xspecvar, chisquare, cstat, get_prior, leastsq, list_samplers, set_prior, set_sampler, set_stat, wstat

Last modified: December 2013
Smithsonian Institute Smithsonian Institute

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