R/fastrmvnorm.R

Defines functions fastrmvnorm

fastrmvnorm = function( cov_mat, cholesky = FALSE ) {
  if ( cholesky == FALSE ) {
    cov_mat = chol(cov_mat)
  }
  d = dim(cov_mat)[ 1 ]
  return(as.vector(t(cov_mat) %*% rnorm(d)))
}

Try the CatReg package in your browser

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

CatReg documentation built on June 14, 2021, 5:07 p.m.