int_proj

sherpa.astro.ui.int_proj(par, id: IdType | None = None, otherids: Sequence[IdType] | None = None, replot=False, fast=True, min=None, max=None, nloop=20, delv=None, fac=1, log=False, numcores=None, overplot=False) None

Calculate and plot the fit statistic versus fit parameter value.

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 free parameters re-fit. It is expected that this is run after a successful fit, so that the parameter values identify the best-fit location.

Changed in version 4.16.1: The log parameter can now be set to True.

Parameters:
  • par – The parameter to plot.

  • id (int, str, or None, optional) – The data set that provides the data. If not given then all data sets with an associated model are used simultaneously.

  • otherids (sequence of int or str, or None, optional) – Other data sets to use in the calculation.

  • replot (bool, optional) – Set to True to use the values calculated by the last call to int_proj. The default is False.

  • 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 (number, optional) – 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 (number, optional) – 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 (int, optional) – The number of steps to use. This is used when delv is set to None.

  • delv (number, optional) – The step size for the parameter. Setting this overrides 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 (bool, 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.

  • overplot (bool, optional) – If True then add the data to an existing plot, otherwise create a new plot. The default is False.

See also

conf

Estimate parameter confidence intervals using the confidence method.

covar

Estimate the confidence intervals using the covariance method.

get_int_proj

Return the interval-projection object.

int_unc

Calculate and plot the fit statistic versus fit parameter value.

reg_proj

Plot the statistic value as two parameters are varied.

Notes

The difference to int_unc is that at each step, a fit is made to the remaining thawed parameters in the source model. This makes the result a more-accurate rendering of the projected shape of the hypersurface formed by the statistic, but the run-time is longer than, the results of int_unc, which does not vary any other parameter. If there are no free parameters in the source expression, other than the parameter being plotted, then the results will be the same.

Examples

Vary the gamma parameter of the p1 model component for all data sets with a source expression.

>>> int_proj(p1.gamma)

Use only the data in data set 1:

>>> int_proj(p1.gamma, id=1)

Use two data sets (‘obs1’ and ‘obs2’):

>>> int_proj(clus.kt, id='obs1', otherids=['obs2'])

Vary the bgnd.c0 parameter between 1e-4 and 2e-4, using 41 points:

>>> int_proj(bgnd.c0, min=1e-4, max=2e-4, step=41)

This time define the step size, rather than the number of steps to use:

>>> int_proj(bgnd.c0, min=1e-4, max=2e-4, delv=2e-6)

Overplot the int_proj results for the parameter on top of the int_unc values:

>>> int_unc(mdl.xpos)
>>> int_proj(mdl.xpos, overplot=True)