    Sample the fit statistic by taking the parameter values
    from a normal distribution.

normal_sample(num=1, sigma=1, correlate=True, id=None, otherids=(), numcores=None)
num - int, optional
sigma - number, optional
correlate - bool, optional
id - int or str, optional
otherids - sequence of int or str, optional
numcores - optional

For each iteration (sample), change the thawed parameters by drawing values from a uni- or multi-variate normal (Gaussian) distribution, and calculate the fit statistic.

The model fit to the default data set has three free parameters. The median value of the statistic calculated by

`normal_sample` is returned:

>>> ans = normal_sample(num=10000) >>> ans.shape (1000, 4) >>> np.median(ans[:,0]) 119.82959326927781

PARAMETERS

The parameters for this function are:

Parameter
Definition
num
The number of samples to use (default is 1).
sigma
The width of the normal distribution (the default is 1).
correlate
Should a multi-variate normal be used, with parameters set by the covariance matrix ( True ) or should a uni-variate normal be used ( False )?
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.
numcores
The number of CPU cores to use. The default is to use all the cores on the machine.

The return value from this function is:

A NumPy array table with the first column representing the statistic and later columns the parameters used.

Notes

All thawed model parameters are sampled from the Gaussian distribution, where the mean is set as the best-fit parameter value and the variance is determined by the diagonal elements of the covariance matrix. The multi-variate Gaussian is assumed by default for correlated parameters, using the off-diagonal elements of the covariance matrix.

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

December 2023