Last modified: December 2023

URL: https://cxc.cfa.harvard.edu/sherpa/ahelp/get_confidence_results.html
Jump to: · Examples · Notes · Bugs


AHELP for CIAO 4.16 Sherpa

get_confidence_results

Context: confidence

Synopsis

Return the results of the last conf run.

Syntax

get_confidence_results()

Alias: get_conf_results

Examples

Example 1

>>> res = get_conf_results()
>>> print(res)
datasets    = (1,)
methodname  = confidence
iterfitname = none
fitname     = levmar
statname    = chi2gehrels
sigma       = 1
percent     = 68.2689492137
parnames    = ('p1.gamma', 'p1.ampl')
parvals     = (2.1585155113403327, 0.00022484014787994827)
parmins     = (-0.082785567348122591, -1.4825550342799376e-05)
parmaxes    = (0.083410634144100104, 1.4825550342799376e-05)
nfits       = 13

Example 2

The following converts the above into a dictionary where the keys are the parameter names and the values are the tuple (best-fit value, lower-limit, upper-limit):

>>> pvals1 = zip(res.parvals, res.parmins, res.parmaxes)
>>> pvals2 = [(v, v+l, v+h) for (v, l, h) in pvals1]
>>> dres = dict(zip(res.parnames, pvals2))
>>> dres['p1.gamma']
(2.1585155113403327, 2.07572994399221, 2.241926145484433)

Notes

The fields of the object include:

Item Definition
datasets A tuple of the data sets used in the analysis.
methodname This will be 'confidence'.
iterfitname The name of the iterated-fit method used, if any.
fitname The name of the optimization method used.
statname The name of the fit statistic used.
sigma The sigma value used to calculate the confidence intervals.
percent The percentage of the signal contained within the confidence intervals (calculated from the sigma value assuming a normal distribution).
parnames A tuple of the parameter names included in the analysis.
parvals A tuple of the best-fit parameter values, in the same order as parnames .
parmins A tuple of the lower error bounds, in the same order as parnames .
parmaxes A tuple of the upper error bounds, in the same order as parnames .
nfits The number of model evaluations.

Bugs

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