This is a pre-release version (latest).Go to latest (1.18.0)
{ } Raw JSON

bundles / scipy latest / scipy / stats / _qmc / MultivariateNormalQMC

class

scipy.stats._qmc:MultivariateNormalQMC

source: build-install/usr/lib/python3.14/site-packages/scipy/stats/_qmc.py:2303

Signature

class MultivariateNormalQMC(mean: npt.ArrayLike, cov: npt.ArrayLike | None = None, *, cov_root: npt.ArrayLike | None = None, inv_transform: bool = True, engine: scipy.stats._qmc.QMCEngine | None = None, rng: SeedType = None, seed = None) → None

Members

Summary

QMC sampling from a multivariate Normal .

Parameters

mean : array_like (d,)

The mean vector. Where d is the dimension.

cov : array_like (d, d), optional

The covariance matrix. If omitted, use cov_root instead. If both cov and cov_root are omitted, use the identity matrix.

cov_root : array_like (d, d'), optional

A root decomposition of the covariance matrix, where d' may be less than d if the covariance is not full rank. If omitted, use cov.

inv_transform : bool, optional

If True, use inverse transform instead of Box-Muller. Default is True.

engine : QMCEngine, optional

Quasi-Monte Carlo engine sampler. If None, Sobol is used.

rng : `numpy.random.Generator`, optional

Pseudorandom number generator state. When rng is 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 a Generator.

Examples

import matplotlib.pyplot as plt
from scipy.stats import qmc
dist = qmc.MultivariateNormalQMC(mean=[0, 5], cov=[[1, 0], [0, 1]])
sample = dist.random(512)
_ = plt.scatter(sample[:, 0], sample[:, 1])
plt.show()
✓
fig-958d0b5207de1c3f.png

Aliases

  • scipy.stats._qmc.MultivariateNormalQMC

Referenced by