bundles / scipy latest / scipy / stats / _resampling / MonteCarloMethod
class
scipy.stats._resampling:MonteCarloMethod
Signature
class MonteCarloMethod ( n_resamples = 9999 , batch = None , rvs = None , rng = None ) Members
Summary
Configuration information for a Monte Carlo hypothesis test.
Extended Summary
Instances of this class can be passed into the method parameter of some hypothesis test functions to perform a Monte Carlo version of the hypothesis tests.
Attributes
n_resamples: int, optionalThe number of Monte Carlo samples to draw. Default is 9999.
batch: int, optionalThe number of Monte Carlo samples to process in each vectorized call to the statistic. Batch sizes >>1 tend to be faster when the statistic is vectorized, but memory usage scales linearly with the batch size. Default is
None, which processes all samples in a single batch.rvs: callable or tuple of callables, optionalA callable or sequence of callables that generates random variates under the null hypothesis. Each element of
rvsmust be a callable that accepts keyword argumentsize(e.g.rvs(size=(m, n))) and returns an N-d array sample of that shape. Ifrvsis a sequence, the number of callables inrvsmust match the number of samples passed to the hypothesis test in which the MonteCarloMethod is used. Default isNone, in which case the hypothesis test function chooses values to match the standard version of the hypothesis test. For example, the null hypothesis of scipy.stats.pearsonr is typically that the samples are drawn from the standard normal distribution, sorvs = (rng.normal, rng.normal)whererng = np.random.default_rng().rng: `numpy.random.Generator`, optionalPseudorandom number generator state. When
rngis None, a new numpy.random.Generator is created using entropy from the operating system. Types other than numpy.random.Generator are passed to numpy.random.default_rng to instantiate aGenerator.
Aliases
-
scipy.stats.MonteCarloMethod