Last modified: December 2013

Jump to: Description · Examples · Bugs · See Also

AHELP for CIAO 4.12 Sherpa v1


Context: confidence


Create a confidence contour of fit statistic vs. two thawed parameter values.


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


The reg_unc command creates a confidence contour of fit statistic as a function of two thawed parameter values. 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 (e.g., delta_S = 11.8 if the statistic is chi-square and 3 is the largest element of the array sigma). The data arrays defining a reg_unc plot may be accessed with the get_reg_unc command (see examples below).

reg_unc differs from reg_proj ("ahelp reg_proj") in that all other thawed parameters are fixed to their best-fit values, rather than being allowed to float to new best-fit values. This makes reg_unc contours less accurate, but faster to create.

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.

The calculated values, such as the grid min and max, can be retrieved with get_reg_unc ("ahelp get_reg_unc").

The plot is displayed in a ChIPS plotting window. If there is no plotting window open, one is created. If a plotting window exists, the overplot parameter value determines whether the new plot is overlaid on any existing plots in the window or if the window is cleared before the plot is drawn.

ChIPS commands may be used within Sherpa to modify plot characteristics and create hardcopies; refer to the ChIPS website for information.


Example 1

sherpa> reg_unc(pl.gamma, pl.ampl)
sherpa> print get_reg_unc()

Using the default settings, run reg_unc on the 'gamma' and 'ampl' parameters of a power-law model ("pl"). Return the confidence data arrays which define the most recently produced reg_unc plot with the get_reg_unc command.

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]

Example 2

sherpa> reg_unc(clus.xpos, clus.ypos, id=1, otherids=[2,3,4])

Run reg_unc on the parameters xpos and ypos from a beta2d model ("clus") for data ids 1, 2, 3, and 4.

Example 3

sherpa> reg_unc(p1.gamma, zabs1.nh, id="src" min=[1.2, 0.15],
max=[1.35, 0.5] )

Run reg_unc for parameters p1.gamma and zabs1.nh, which are model components assigned to data id "src". The min and max grid values are manually set.


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, get_reg_unc, int_proj, int_unc, projection, reg_proj, set_conf_opt, set_covar_opt, set_proj_opt