50% off | Unlimited Data & AI Learning

Last chance! 50% off unlimited learning

Sale ends in


mev (version 1.16)

mvrnorm: Multivariate Normal distribution sampler

Description

Sampler derived using the eigendecomposition of the covariance matrix Sigma. The function uses the Armadillo random normal generator

Usage

mvrnorm(n, mu, Sigma)

Value

an n sample from a multivariate Normal distribution

Arguments

n

sample size

mu

mean vector. Will set the dimension

Sigma

a square covariance matrix, of same dimension as mu. No sanity check is performed to validate that the matrix is p.s.d., so use at own risk

Examples

Run this code
mvrnorm(n=10, mu=c(0,2), Sigma=diag(2))

Run the code above in your browser using DataLab