Synopsis
Calculate and plot the fit statistic versus fit parameter value.
Syntax
int_unc(par, id=None, otherids=None, replot=False, min=None, max=None, nloop=20, delv=None, fac=1, log=False, numcores=None, overplot=False) id - int or str, optional otherids - sequence of int or str, optional replot - bool, optional min - number, optional max - number, optional nloop - int, optional delv - number, optional fac - number, optional log - bool, optional numcores - optional overplot - bool, optional
Description
Create a confidence plot of the fit statistic as a function of parameter value. Dashed lines are added to indicate the current statistic value and the parameter value at this point. The parameter value is varied over a grid of points and the statistic evaluated while holding the other parameters fixed. It is expected that this is run after a successful fit, so that the parameter values identify the best-fit location.
Examples
Example 1
Vary the gamma parameter of the p1 model component for all data sets with a source expression.
>>> int_unc(p1.gamma)
Example 2
Use only the data in data set 1:
>>> int_unc(p1.gamma, id=1)
Example 3
Use two data sets ('obs1' and 'obs2'):
>>> int_unc(clus.kt, id='obs1', otherids=['obs2'])
Example 4
Vary the bgnd.c0 parameter between 1e-4 and 2e-4, using 41 points:
>>> int_unc(bgnd.c0, min=1e-4, max=2e-4, step=41)
Example 5
This time define the step size, rather than the number of steps to use:
>>> int_unc(bgnd.c0, min=1e-4, max=2e-4, delv=2e-6)
Example 6
Overplot the `int_unc` results for the parameter on top of the `int_proj` values:
>>> int_proj(mdl.xpos) >>> int_unc(mdl.xpos, overplot=True)
PARAMETERS
The parameters for this function are:
Parameter | Definition |
---|---|
par | The parameter to plot. |
id | The data set that provides the data. If not given then all data sets with an associated model are used simultaneously. |
otherids | Other data sets to use in the calculation. |
replot | Set to True to use the values calculated by the last call to `int_proj` . The default is False . |
min | The minimum parameter value for the calculation. The default value of none means that the limit is calculated from the covariance, using the `fac` value. |
max | The maximum parameter value for the calculation. The default value of none means that the limit is calculated from the covariance, using the `fac` value. |
nloop | The number of steps to use. This is used when `delv` is set to none . |
delv | The step size for the parameter. Setting this over-rides the `nloop` parameter. The default is none . |
fac | 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 | Should the step size be logarithmically spaced? The default ( False ) is to use a linear grid. |
numcores | The number of CPU cores to use. The default is to use all the cores on the machine. |
overplot | If True then add the data to an existing plot, otherwise create a new plot. The default is False . |
Notes
The difference to `int_proj` is that at each step only the single parameter value is varied while all other parameters remain at their starting value. This makes the result a less-accurate rendering of the projected shape of the hypersurface formed by the statistic, but the run-time is likely shorter than, the results of `int_proj` , which fits the model to the remaining thawed parameters at each step. If there are no free parameters in the source expression, other than the parameter being plotted, then the results will be the same.
Bugs
See the bugs pages on the Sherpa website for an up-to-date listing of known bugs.
See Also
- confidence
- conf, confidence, covar, covariance, get_conf, get_conf_results, get_covar, get_covar_opt, get_covar_results, get_covariance_results, get_int_proj, get_int_unc, get_proj, get_proj_opt, get_proj_results, get_projection_results, get_reg_proj, get_reg_unc, int_proj, proj, projection, reg_proj, reg_unc, set_conf_opt, set_covar_opt, set_proj_opt