Learn R Programming

VBmix (version 0.3.2)

mvngen:

Description

sample nitem elements from N(mean, cov).

Usage

mvngen(mean, cov, nitem)

Arguments

mean
numeric vector.
cov
covariance matrix.
nitem
number of items to generate.

Value

nitem x d matrix with elements as rows (further denoted as a matrix of row-elements).

Examples

Run this code
mvngen(c(0, 0), diag(2), 5)
#       [,1]        [,2]
#[1,] -0.09898211  1.4516438
#[2,]  0.20814926 -0.1233861
#[3,]  0.18410071  0.5995621
#[4,]  0.65994562  0.8328315
#[5,]  2.33098055 -0.5943117

Run the code above in your browser using DataLab