ParameterSampleFromScaleMatrix

class sherpa.sim.sample.ParameterSampleFromScaleMatrix[source] [edit on github]

Bases: ParameterSample

Samples drawn from correlated parameters.

Methods

clip(fit, samples[, clip])

Clip the samples if out of bounds.

get_sample(fit, *[, num, rng])

Return the samples.

Methods Summary

clip(fit, samples[, clip])

Clip the samples if out of bounds.

get_sample(fit, *[, num, rng])

Return the samples.

Methods Documentation

clip(fit: Fit, samples: ndarray, clip: Literal['none', 'hard', 'soft'] = 'none') ndarray [edit on github]

Clip the samples if out of bounds.

Parameters:
fitsherpa.fit.Fit instance

Contains the thawed parameters used to generate the samples.

samples2D numpy array

The samples array, stored as a n by npar matrix. This array is changed in place.

clip{‘none’, ‘hard’, ‘soft’} optional

How should the values be clipped? The default (‘none’) has no clipping. The other methods restrict the values to lie within the hard or soft limits of the parameters.

Returns:
clipped1D numpy array

A 1D boolean array indicating whether any sample in a row was clipped. Note that the input samples array will have been updated if any element in clipped is True.

get_sample(fit: Fit, *, num: int = 1, rng: Generator | RandomState | None = None) ndarray [edit on github]

Return the samples.

Changed in version 4.16.0: All arguments but the first one must be passed as a keyword argument. The rng parameter was added.

Parameters:
fitsherpa.fit.Fit instance

This defines the thawed parameters that are used to generate the samples, along with any possible error analysis.

numint, optional

The number of samples to return.

rngnumpy.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:
samples2D numpy array

The array is num by npar size, where npar is the number of free parameters in the fit argument.