cupy.random.multivariate_normal

cupy.random.multivariate_normal(mean, cov, size=None, check_valid='ignore', tol=1e-08, dtype=<class 'float'>)[source]

(experimental) Multivariate normal distribution.

Returns an array of samples drawn from the multivariate normal distribution. Its probability density function is defined as

\[f(x) = \frac{1}{(2\pi|\Sigma|)^(n/2)} \exp\left(-\frac{1}{2} (x-\mu)^{\top}\Sigma^{-1}(x-\mu)\right).\]
Parameters:
  • mean (1-D array_like, of length N) – Mean of the multivariate normal distribution \(\mu\).
  • cov (2-D array_like, of shape (N, N)) – Covariance matrix \(\Sigma\) of the multivariate normal distribution. It must be symmetric and positive-semidefinite for proper sampling.
  • size (int or tuple of ints) – The shape of the array. If None, a zero-dimensional array is generated.
  • check_valid ('warn', 'raise', 'ignore') – Behavior when the covariance matrix is not positive semidefinite.
  • tol (float) – Tolerance when checking the singular values in covariance matrix.
  • dtype – Data type specifier. Only numpy.float32 and numpy.float64 types are allowed.
Returns:

Samples drawn from the multivariate normal distribution.

Return type:

cupy.ndarray

See also

numpy.random.multivariate_normal