Last modified: December 2013

Jump to: Description · Examples · Bugs · See Also

AHELP for CIAO 4.11 Sherpa v1


Context: confidence


Return the confidence data defining a reg_unc() contour plot


get_reg_unc( [par0=None, par1=None, id, otherids=None, recalc=False,
min=None, max=None, nloop=(10, 10), delv=None, fac=4, log=(False,
False), sigma=(1,2,3), levels=None,numcores] )


The get_reg_unc() function returns the data defining a confidence contour of fit statistic as a function of two thawed model parameter values, produced by the reg_unc() function. (The confidence regions are determined by varying the value of each selected parameter on the grid, computing the best-fit statistic at each grid point, and interpolating on the grid. Each parameter value is varied until the fit statistic is increased by delta_S, which is a function of the largest value of sigma. For example, delta_S = 11.8 if the statistic is chi^2 and 3 is the largest element of the sigma array. All other parameters are fixed to the initial best-fit values.)

The get_reg_unc() function returns information on the most recent confidence contour plot produced with reg_unc(), independent of the arguments supplied, unless the 'recalc' argument is set to True . For example, if a confidence contour plot is produced for the amplitude and gamma parameters of a power law model, and then get_reg_unc() is used to obtain confidence data for a different pair of model parameters, the information returned by get_reg_unc() will correspond to the confidence contour of the amplitude and gamma parameters, *unless* the 'recalc' argument is switched on.

The computationally intensive projection function is parallelized to make use of multi-core systems (i.e., laptops or desktops with 2 or 4 cores) to provide significant improvements in efficiency compared to previous releases of Sherpa; the 'numcores' argument may be used to specify how the cores should be used when projection is run.


Example 1

sherpa> print(get_reg_unc())

When called with no arguments from within the print command, get_reg_unc() returns the confidence data defining the most recently produced reg_unc() contour plot.

sherpa> reg_unc(pl.gamma, pl.ampl)
sherpa> print get_reg_unc()
x0      = [ 1.8274  1.901   1.9745 ...,  2.3425  2.4161  2.4897]
x1      = [ 0.0002  0.0002  0.0002 ...,  0.0003  0.0003  0.0003]
y       = [ 55.7019  53.6498  54.4308 ...,  54.3251  56.0053  59.9229]
min     = [  1.8274e+00   1.6554e-04]
max     = [  2.4897e+00   2.8414e-04]
nloop   = (10, 10)
fac     = 4
delv    = None
log     = [False False]
sigma   = (1, 2, 3)
parval0 = 2.15851551134
parval1 = 0.00022484014788
levels  = [ 40.2037  44.088   49.7371]

where the x0, x1, and y arrays contain the par0 values, par1 values, and fit statistic values, respectively.

Example 2

sherpa> print(get_reg_unc("p1.gamma", "p1.ampl", id=2, recalc=True))

This command will calculate and return the reg_unc() confidence data for the amplitude and gamma parameters of the power law model 'p1' assigned to data set 2. Since the 'recalc' argument is set to True, the confidence data for this set of parameters will be returned regardless of whether or not they were the last ones used with reg_unc.


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

See Also

conf, covariance, get_conf, get_covar, get_int_proj, get_int_unc, get_proj, get_reg_proj, int_proj, int_unc, projection, reg_proj, reg_unc, set_conf_opt, set_covar_opt, set_proj_opt
get_chart_spectrum, get_marx_spectrum
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
calc_stat_info, get_fit, get_stat_info
get_default_id, list_stats
get_draws, get_iter_method_name, get_iter_method_opt, get_method
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
get_kernel, get_psf
get_chisqr_plot, get_delchi_plot, get_prior, get_sampler, get_stat
get_analysis, get_rate
get_ratio, get_resid, image_getregion