t_sample

sherpa.sim.sample.t_sample(fit, num=1, dof=2, numcores=None, rng=None)[source] [edit on github]

Sample the fit statistic by taking the parameter values from a Student’s t-distribution.

For each iteration (sample), change the thawed parameters by drawing values from a Student’s t-distribution, and calculate the fit statistic.

Changed in version 4.16.0: The rng parameter was added.

Parameters:
  • fit – The fit results.

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

  • dof (optional) – The number of degrees of freedom to use (the default is to use the number from the current fit).

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

  • rng (numpy.random.Generator, numpy.random.RandomState, or None, optional) – Determines how random numbers are created. If set to None then the routines from numpy.random are used, and so can be controlled by calling numpy.random.seed.

Returns:

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

Return type:

samples

See also

normal_sample

Sample from the normal distribution.

uniform_sample

Sample from a uniform distribution.