get_covariance_results
- sherpa.astro.ui.get_covariance_results()
Return the results of the last
covarrun.- Returns:
results
- Return type:
sherpa.fit.ErrorEstResults object
- Raises:
sherpa.utils.err.SessionErr – If no
covarcall has been made.
See also
get_covar_optReturn one or all of the options for the covariance method.
set_covar_optSet an option of the covar estimation object.
Notes
The fields of the object include:
datasetsA tuple of the data sets used in the analysis.
methodnameThis will be ‘covariance’.
iterfitnameThe name of the iterated-fit method used, if any.
fitnameThe name of the optimization method used.
statnameThe name of the fit statistic used.
sigmaThe sigma value used to calculate the confidence intervals.
percentThe percentage of the signal contained within the confidence intervals (calculated from the
sigmavalue assuming a normal distribution).parnamesA tuple of the parameter names included in the analysis.
parvalsA tuple of the best-fit parameter values, in the same order as
parnames.parminsA tuple of the lower error bounds, in the same order as
parnames.parmaxesA tuple of the upper error bounds, in the same order as
parnames.nfitsThe number of model evaluations.
There is also an
extra_outputfield 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]])