| AHELP for CIAO 4.5 Sherpa v1 | get_covar |
Context: confidence |
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 is:
- sigma - to get 1, 2, or 3-sigma limits, default=1
- 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
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. The covariance options are modified using the set_covar_opt command.
- sigma - to get 1, 2, or 3-sigma limits, default=1
- 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
sherpa> set_covar_opt("sigma",3)Return the current value of the covariance sigma option ('1' in this example), and change it to the desired value ('3').
Example 4
sherpa> print get_covar_results().extra_output [[ 1.00688203e-07 1.94309062e-07 1.63077981e-07 -2.14579320e-08 -2.33234708e-07] [ 1.94309062e-07 5.97149180e-08 6.14497850e-07 5.95866729e-07 -3.20550581e-07] [ 1.63077981e-07 6.14497850e-07 1.36168008e-06 9.66523748e-07 -1.53815319e-06] [ -2.14579320e-08 5.95866729e-07 9.66523748e-07 4.53031826e-06 -1.61278260e-06] [ -2.33234708e-07 -3.20550581e-07 -1.53815319e-06 -1.61278260e-06 1.74050730e-06]]
Retrieve the covariance matrix as a numpy N-D array.
Bugs
See the bugs pages on the Sherpa website for an up-to-date listing of known bugs.
See Also
- confidence
- conf, covariance, get_conf, get_int_proj, get_int_unc, get_proj, get_reg_proj, get_reg_unc, int_proj, int_unc, projection, reg_proj, reg_unc, set_conf_opt, set_covar_opt, set_proj_opt
- contrib
- get_chart_spectrum
- data
- get_areascal, get_arf, get_arf_plot, get_axes, get_backscal, get_bkg, get_bkg_plot, get_bkg_scale, get_coord, get_counts, get_data, get_data_plot, get_dep, get_dims, get_error, get_exposure, get_grouping, get_indep, get_quality, get_rmf, get_specresp, get_staterror, get_syserror
- filtering
- get_filter
- fitting
- calc_stat_info, get_fit, get_stat_info
- info
- get_default_id, list_stats
- methods
- get_draws, get_iter_method_name, get_iter_method_opt, get_method
- modeling
- get_model, get_model_component, get_model_component_image, get_model_component_plot, get_model_plot, get_num_par, get_order_plot, get_par, get_pileup_model, get_response, get_source, get_source_component_image, get_source_component_plot, image_source
- plotting
- get_split_plot
- psfs
- get_kernel, get_psf
- statistics
- get_chisqr_plot, get_delchi_plot, get_prior, get_sampler, get_stat
- utilities
- get_analysis, get_rate
- visualization
- get_ratio, get_resid, image_getregion

![[Sherpa Logo]](../imgs/sherpa_logo_navbar.gif)