t_sample
- sherpa.sim.sample.t_sample(fit: Fit, num: int = 1, dof: int = 2, numcores: int | None = None, rng: Generator | RandomState | None = None, clip: Literal['none', 'hard', 'soft'] = 'none') ndarray[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.18.0: The sigma parameter has been renamed to scale, and the code has been updated so that changing it will change the sampled values. The clip parameter has been added, and the return value contains an extra column indicating whether a parameter in the row was clipped.
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.randomare used, and so can be controlled by callingnumpy.random.seed.clip ({'hard', 'soft', 'none'}, optional) – What clipping strategy should be applied to the sampled parameters. The default (‘none’) applies no clipping, ‘hard’ uses the hard parameter limits, and ‘soft’ the soft limits.
- Returns:
A NumPy array table with the first column representing the statistic, the later columns the parameters used, and the last column indicating whether any parameter in the row was clipped.
- Return type:
samples
See also
normal_sampleSample from the normal distribution.
uniform_sampleSample from a uniform distribution.