scipy.stats.qmc.MultinomialQMC#
- class scipy.stats.qmc.MultinomialQMC(pvals, n_trials, *, engine=None, seed=None)[source]#
QMC sampling from a multinomial distribution.
- Parameters
- pvalsarray_like (k,)
Vector of probabilities of size
k
, wherek
is the number of categories. Elements must be non-negative and sum to 1.- n_trialsint
Number of trials.
- engineQMCEngine, optional
Quasi-Monte Carlo engine sampler. If None,
Sobol
is used.- seed{None, int,
numpy.random.Generator
}, optional If seed is None the
numpy.random.Generator
singleton is used. If seed is an int, a newGenerator
instance is used, seeded with seed. If seed is already aGenerator
instance then that instance is used.
Examples
>>> from scipy.stats import qmc >>> dist = qmc.MultinomialQMC(pvals=[0.2, 0.4, 0.4], n_trials=10) >>> sample = dist.random(10)
Methods
random
([n])Draw n QMC samples from the multinomial distribution.