get_int_unc
- sherpa.astro.ui.get_int_unc(par: str | Parameter | None = None, id: IdType | None = None, otherids: IdTypes | None = None, recalc: bool = False, min: float | None = None, max: float | None = None, nloop: int = 20, delv: float | None = None, fac: float = 1, log: bool = False, numcores: int | None = None, copy: bool = True)
Return the interval-uncertainty object.
This returns (and optionally calculates) the data used to display the
int_uncplot. Note that if the therecalcparameter isFalse(the default value) then all other parameters are ignored and the results of the lastint_unccall are returned.Changed in version 4.19.0: The plot object is now copied by default. To get the previous behaviour set the
copyattribute toFalse.Changed in version 4.16.1: The log parameter can now be set to
True.- Parameters:
- par
The parameter to plot. This argument is only used if
recalcis set toTrue.- id
str,int,orNone,optional The data set that provides the data. If not given then all data sets with an associated model are used simultaneously.
- otherids
listofstrorint,orNone,optional Other data sets to use in the calculation.
- recalcbool,
optional The default value (
False) means that the results from the last call toint_proj(orget_int_proj) are returned, ignoring all other parameter values. Otherwise, the statistic curve is re-calculated, but not plotted.- min
number,optional The minimum parameter value for the calculation. The default value of
Nonemeans that the limit is calculated from the covariance, using thefacvalue.- max
number,optional The maximum parameter value for the calculation. The default value of
Nonemeans that the limit is calculated from the covariance, using thefacvalue.- nloop
int,optional The number of steps to use. This is used when
delvis set toNone.- delv
number,optional The step size for the parameter. Setting this overrides the
nloopparameter. The default isNone.- fac
number,optional When
minormaxis 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).- logbool,
optional Should the step size be logarithmically spaced? The default (
False) is to use a linear grid.- numcores
optional The number of CPU cores to use. The default is to use all the cores on the machine.
- copybool,
optional Is the plot object copied before being returned? If so then the plot attributes will not be changed by multiple calls to this routine.
- Returns:
- iunc
asherpa.plot.IntervalUncertaintyinstance The fields of this object can be used to re-create the plot created by
int_unc.
- iunc
See also
confEstimate parameter confidence intervals using the confidence method.
covarEstimate the confidence intervals using the covariance method.
int_projCalculate and plot the fit statistic versus fit parameter value.
int_uncCalculate and plot the fit statistic versus fit parameter value.
reg_projPlot the statistic value as two parameters are varied.
Examples
Return the results of the
int_uncrun:>>> int_unc(src.xpos) >>> iunc = get_int_unc() >>> min(iunc.y) 119.55942437129544
Since the
recalcparameter has not been changed toTrue, the following will return the results for the last call toint_unc, which may not have been for the src.ypos parameter:>>> iunc = get_int_unc(src.ypos)
Create the data without creating a plot:
>>> iunc = get_int_unc(pl.gamma, recalc=True)
Specify the range and step size for the parameter, in this case varying linearly between 12 and 14 with 51 values:
>>> iunc = get_int_unc(src.r0, id="src", min=12, max=14, ... nloop=51, recalc=True)