Extended Generator¶
The ExtendedGenerator
provides access to a small number of distributions that are not present in NumPy. The default bit generator used by ExtendedGenerator
is PCG64
. The bit generator can be changed by passing an instantized bit generator to ExtendedGenerator
. It is also possible to share a bit generator with an instance of NumPy’s numpy.random.Generator
.
- class randomgen.generator.ExtendedGenerator(bit_generator=None)¶
Additional random value generator using a bit generator source.
ExtendedGenerator
exposes methods for generating random numbers from some distributions that are not in numpy.random.Generator.- Parameters
- bit_generatorBitGenerator, optional
Bit generator to use as the core generator. If none is provided, uses PCG64(variant=”cm-dxsm”).
See also
numpy.random.Generator
The primary generator of random variates.
Examples
>>> from randomgen import ExtendedGenerator >>> rg = ExtendedGenerator() >>> rg.complex_normal() -0.203 + .936j # random
Using a specific generator
>>> from randomgen import MT19937 >>> rg = ExtendedGenerator(MT19937())
Share a bit generator with numpy
>>> from numpy.random import Generator, PCG64 >>> pcg = PCG64() >>> gen = Generator(pcg) >>> eg = ExtendedGenerator(pcg)
Seed and State Manipulation¶
Get or set the bit generator's state | |
Gets the bit generator instance used by the generator |
Distributions¶
| Return random unsigned integers |
| Return random floats in the half-open interval [0.0, 1.0). |
| Draw random samples from a complex normal (Gaussian) distribution. |
| Draw random samples from a multivariate normal distribution. |
| Draw random samples from a multivariate complex normal (Gaussian) distribution. |
| Draw samples from the Standard Wishart and Pseudo-Wishart distributions |
| Draw samples from the Wishart and pseudo-Wishart distributions. |