# get_reg_unc¶

sherpa.astro.ui.get_reg_unc(par0=None, par1=None, id=None, 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=None)

Return the region-uncertainty object.

This returns (and optionally calculates) the data used to display the reg_unc contour plot. Note that if the the recalc parameter is False (the default value) then all other parameters are ignored and the results of the last reg_unc call are returned.

Parameters
• par0 – The parameters to plot on the X and Y axes, respectively. These arguments are only used if recalc is set to True.

• par1 – The parameters to plot on the X and Y axes, respectively. These arguments are only used if recalc is set to True.

• id (str or int, optional) –

• otherids (list of str or int, optional) – The id and otherids arguments determine which data set or data sets are used. If not given, all data sets which have a defined source model are used.

• recalc (bool, optional) – The default value (False) means that the results from the last call to reg_unc (or get_reg_unc) are returned, ignoring all other parameter values. Otherwise, the statistic curve is re-calculated, but not plotted.

• fast (bool, optional) – If True then the fit optimization used may be changed from the current setting (only for the error analysis) to use a faster optimization method. The default is False.

• min (pair of numbers, optional) – The minimum parameter value for the calcutation. The default value of None means that the limit is calculated from the covariance, using the fac value.

• max (pair of number, optional) – The maximum parameter value for the calcutation. The default value of None means that the limit is calculated from the covariance, using the fac value.

• nloop (pair of int, optional) – The number of steps to use. This is used when delv is set to None.

• delv (pair of number, optional) – The step size for the parameter. Setting this over-rides the nloop parameter. The default is None.

• fac (number, optional) – When min or max is not given, multiply the covariance of the parameter by this value to calculate the limit (which is then added or subtracted to the parameter value, as required).

• log (pair of bool, optional) – Should the step size be logarithmically spaced? The default (False) is to use a linear grid.

• sigma (sequence of number, optional) – The levels at which to draw the contours. The units are the change in significance relative to the starting value, in units of sigma.

• levels (sequence of number, optional) – The numeric values at which to draw the contours. This over-rides the sigma parameter, if set (the default is None).

• numcores (optional) – The number of CPU cores to use. The default is to use all the cores on the machine.

Returns

rproj – The fields of this object can be used to re-create the plot created by reg_unc.

Return type

a sherpa.plot.RegionUncertainty instance

conf()

Estimate patameter confidence intervals using the confidence method.

covar()

Estimate the confidence intervals using the covariance method.

int_proj()

Calculate and plot the fit statistic versus fit parameter value.

int_unc()

Calculate and plot the fit statistic versus fit parameter value.

reg_proj()

Plot the statistic value as two parameters are varied.

reg_unc()

Plot the statistic value as two parameters are varied.

Examples

Return the results for the reg_unc run for the xpos and ypos parameters of the src component, for the default data set:

>>> reg_unc(src.xpos, src.ypos)
>>> runc = get_reg_unc()


Since the recalc parameter has not been changed to True, the following will return the results for the last call to reg_unc, which may not have been for the r0 and alpha parameters:

>>> runc = get_reg_unc(src.r0, src.alpha)


Create the data without creating a plot:

>>> runc = get_reg_unc(pl.gamma, gal.nh, recalc=True)


Specify the range and step size for both the parameters, in this case pl.gamma should vary between 0.5 and 2.5, with gal.nh between 0.01 and 1, both with 51 values and the nH range done over a log scale:

>>> runc = get_reg_unc(pl.gamma, gal.nh, id="src",
...                    min=(0.5, 0.01), max=(2.5, 1),
...                    nloop=(51, 51), log=(False, True),
...                    recalc=True)