normal_sample

sherpa.sim.sample.normal_sample(fit, num=1, sigma=1, correlate=True, numcores=None)[source] [edit on github]

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

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.

Parameters
  • fit – The fit results.

  • num (int, optional) – The number of samples to use (default is 1).

  • sigma (number, optional) – The width of the normal distribution (the default is 1).

  • correlate (bool, optional) – Should a multi-variate normal be used, with parameters set by the covariance matrix (True) or should a uni-variate normal be used (False)?

  • numcores (optional) – The number of CPU cores to use. The default is to use all the cores on the machine.

Returns

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

Return type

samples

See also

t_sample

Sample from the Student’s t-distribution.

uniform_sample

Sample from a uniform distribution.

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.