R/rmnorm.R

rmnorm <- function (n = 1, mean = rep(0, d), varcov) 
# FROM LearnBayes
{
    d <- if (is.matrix(varcov)) 
        ncol(varcov)
    else 1
    z <- matrix(rnorm(n * d), n, d) %*% chol(varcov)
    y <- t(mean + t(z))
    return(y)
}

Try the anoint package in your browser

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

anoint documentation built on May 2, 2019, 3:26 p.m.