R/rmn.R

Defines functions rmn

Documented in rmn

rmn <- function(k, M, U, V) {

  n <- dim(M)[1]  ;  p <- dim(M)[2]
  A <- chol(U)  ;  B <- chol(V)
  Y <- list()
  for ( i in 1:k ) {
    X <- Rfast::matrnorm(n, p)
    Y[[ i ]] <- M + A %*% X %*% B
  }
  Y

}

Try the MN package in your browser

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

MN documentation built on June 22, 2024, 11:07 a.m.