    Set the statistical errors on the dependent axis of a data set.

set_staterror(id, val=None, fractional=False, bkg_id=None)
id - int or str, optional
val - array or scalar
fractional - bool, optional
bkg_id - int or str, optional

These values over-ride the errors calculated by any statistic, such as chi2gehrels or chi2datavar .

Set the statistical error for the default data set to the value in dys (a scalar or an array):

>>> set_staterror(dys)

Set the statistical error on the 'core' data set to be 5% of the data values:

>>> set_staterror('core', 0.05, fractional=True)

PARAMETERS

The parameters for this function are:

Parameter
Definition
id
The identifier for the data set to use. If not given then the default identifier is used, as returned by

`get_default_id` .
val
The systematic error.
fractional
If False (the default value), then the `val` parameter is the absolute value, otherwise the `val` parameter represents the fractional error, so the absolute value is calculated as get_dep() * val (and `val` must be a scalar).
bkg_id
Set to identify which background component to set. The default value ( none ) means that this is for the source component of the data set.

Notes

The function does not follow the normal Python standards for parameter use, since it is designed for easy interactive use. When called with a single un-named argument, it is taken to be the `val` parameter. If given two un-named arguments, then they are interpreted as the `id` and `val` parameters, respectively.

See the bugs pages on the Sherpa website for an up-to-date listing of known bugs.

December 2023