rmvnorm {lazy.stat}R Documentation

Multivariate Normal Random Numbers

Description

Multivariate Normal Random Numbers

Usage

rmvnorm(n, mu, Sigma)

Arguments

n

# of random numbers to be generated

mu

The mean vector

Sigma

The Variance-Covariane Matrix (Dispersion Matrix)

Details

When Sigma is not full rank, degenerated random numbers will be returned.

Examples

set.seed=(1701)
n=1000
# nonsingular Sigma
mu=c(10,20); Sigma=matrix(c(5,2,2,2),2,2)
X=rmvnorm(n,mu,Sigma)
md=mandd(X)
# singular Sigma
mu=c(10,20); Sigma=matrix(c(2,2,2,2),2,2)
X=rmvnorm(n,mu,Sigma)
md=mandd(X)


[Package lazy.stat version 0.1.4 Index]