scipy.stats.qmc.MultinomialQMC¶
- class scipy.stats.qmc.MultinomialQMC(pvals, *, 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.- 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 >>> engine = qmc.MultinomialQMC(pvals=[0.2, 0.4, 0.4]) >>> sample = engine.random(10)
Methods
fast_forward
(n)Fast-forward the sequence by n positions.
random
([n])Draw n QMC samples from the multinomial distribution.
reset
()Reset the engine to base state.