R/rmnorm.R

rmnorm <- function (n = 1, mean = rep(0, d), varcov) 
{
    varcov <- as.matrix(varcov)
    d <- ncol(varcov)
    z <- matrix(rnorm(n * d), n, d) %*% chol(varcov)
    y <- t(mean + t(z))
    y
}

Try the ocomposition package in your browser

Any scripts or data that you put into this service are public.

ocomposition documentation built on May 2, 2019, 3:30 p.m.