NormalParameterSampleFromScaleMatrix
- class sherpa.sim.sample.NormalParameterSampleFromScaleMatrix[source] [edit on github]
Bases:
ParameterSampleFromScaleMatrixUse a normal distribution to sample parameters (correlated),
The parameters are drawn from a normal distribution based on the parameter errors, and include the correlations between the parameters. The errors will be generated from the fit object or specified directly as a covariance matrix.
Methods
clip(fit, samples[, clip])Clip the samples if out of bounds.
get_sample(fit, *[, mycov, num, rng])Return the parameter samples.
Methods Summary
clip(fit, samples[, clip])Clip the samples if out of bounds.
get_sample(fit, *[, mycov, num, rng])Return the parameter 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:
- fit
sherpa.fit.Fitinstance Contains the thawed parameters used to generate the samples.
- samples2D
numpyarray 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.
- fit
- Returns:
- get_sample(fit: Fit, *, mycov: ndarray | None = None, num: int = 1, rng: Generator | RandomState | None = None) ndarray[source] [edit on github]
Return the parameter 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:
- fit
sherpa.fit.Fitinstance This defines the thawed parameters that are used to generate the samples, along with any possible error analysis.
- mycov2D
numpyarrayorNone,optional The covariance matrix for the free parameters in the fit. If None then the values are calculated from the fit and scaled by the sigma value of the scale object.
- num
int,optional The number of samples to return.
- rng
numpy.random.Generator,numpy.random.RandomState,orNone,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.
- fit
- Returns: