get_covar_results

sherpa.astro.ui.get_covar_results()

Return the results of the last covar run.

Returns

results

Return type

sherpa.fit.ErrorEstResults object

Raises

sherpa.utils.err.SessionErr – If no covar call has been made.

See also

get_covar_opt

Return one or all of the options for the covariance method.

set_covar_opt

Set an option of the covar estimation object.

Notes

The fields of the object include:

datasets

A tuple of the data sets used in the analysis.

methodname

This will be ‘covariance’.

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.

There is also an extra_output field which is used to return the covariance matrix.

Examples

>>> res = get_covar_results()
>>> print(res)
datasets    = (1,)
methodname  = covariance
iterfitname = none
fitname     = levmar
statname    = chi2gehrels
sigma       = 1
percent     = 68.2689492137
parnames    = ('bgnd.c0',)
parvals     = (10.228675427602724,)
parmins     = (-2.4896739438296795,)
parmaxes    = (2.4896739438296795,)
nfits       = 0

In this case, of a single parameter, the covariance matrix is just the variance of the parameter:

>>> res.extra_output
array([[ 6.19847635]])