About Chandra Archive Proposer Instruments & Calibration Newsletters Data Analysis HelpDesk Calibration Database NASA Archives & Centers Chandra Science Links

Skip the navigation links
Last modified: December 2008

URL: http://cxc.harvard.edu/sherpa4.1/get_covar.py.html
AHELP for Sherpa 4.1

get_covar

Context: py.sherpa

Synopsis

Return settings or results for the covariance method.

Syntax

get_covar()
get_covar_results()
get_covar_opt( [name] )

Description

get_covar

The get_covar command returns the current covariance estimation method object. The function accepts no arguments. The returned information includes:

  • sigma - to get 1, 2, or 3-sigma limits
  • eps - precision of resulting limits
  • maxiters- maximum number of tries to bracket desired limits, before returning
  • soft_limits - a switch which allows the search to go all the way out to the hard parameter limits; if switched on, the search will be restricted to occur within the soft limits, which can be changed by the user

get_covar_results

The get_covar_results command accesses results from the last time covariance was run. The function accepts no arguments. The results include the following attributes:

  • datasets - Data sets in fit
  • methodname - Estimation method name
  • fitname - Fitting method name
  • statname - Statistic name
  • percent
  • sigma - Change in statistic
  • parnames - Model parameter names
  • parvals - Model parameter fit values
  • parmins - Model parameter minimum values
  • parmaxes - Model parameter maximum values
  • extra_output - the covariance matrix

get_covar_opt

The get_covar_opt command returns a covariance option by name. If the name isn't specified, it returns a dictionary of all options that govern how covariance is run.

  • sigma - to get 1, 2, or 3-sigma limits, default=0.01
  • eps - precision of resulting limits, default=0.01
  • maxiters- maximum number of tries to bracket desired limits, before returning, default=200
  • soft_limits - a switch which allows the search to go all the way out to the hard parameter limits; if switched on, the search will be restricted to occur within the soft limits, which can be changed by the user, default=False

Example 1

sherpa> get_covar()

Return a variable listing of all settings that govern how the covariance method calculates confidence limits. Sample output is

sherpa> print(get_covar())
name        = covariance
soft_limits = False
maxiters    = 200
sigma       = 1
eps         = 0.01

Example 2

sherpa> get_covar_results()

Return a variable listing of all results from the last time covariance was run, e.g.

sherpa> print(get_covar_results())
data sets   = (2,)
methodname = covariance
fitname    = levmar
statname   = chi2gehrels
sigma      = 1
percent    = 68.2689492137
parnames   = ('p2.gamma', 'p2.ampl')
parvals    = (1.0, 1.0)
parmins    = (-2.5123712497785912e-05, -1.8031410361942839e-05)
parmaxes   = (2.5123712497785912e-05, 1.8031410361942839e-05)
nfits      = 0

Example 3

sherpa> get_covar_opt("sigma")
1

Return the value of the sigma option, which is "1" in this example.

CHANGES IN CIAO 4.1.2

Covariance Matrix

The covariance matrix is now available after covar() is run, via the "extra_output" field from get_covar_results().

Bugs

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

Last modified: December 2008



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-2004. All rights reserved.