Learn R Programming

ksm (version 1.0)

rmnorm: Random vector generation from the multivariate normal distribution

Description

Sampler derived using the eigendecomposition of the covariance matrix vcov.

Usage

rmnorm(n, mean, vcov)

Value

an n by d matrix of samples

Arguments

n

sample size

mean

mean vector of length d

vcov

a square positive definite covariance matrix, of the same dimension as mean.

Examples

Run this code
rmnorm(n = 10, mean = c(0, 2), vcov = diag(2))

Run the code above in your browser using DataLab