Learn R Programming

contextual (version 0.9.8.4)

mvrnorm: Simulate from a Multivariate Normal Distribution

Description

Produces one or more samples from the specified multivariate normal distribution.

Usage

mvrnorm(n, mu, sigma)

Arguments

n

the number of samples required.

mu

a vector giving the means of the variables.

sigma

a positive-definite symmetric matrix specifying the covariance matrix of the variables.

Value

If n = 1 a vector of the same length as mu, otherwise an n by length(mu) matrix with one sample in each row.