R/randomGaussian-random-gaussian-eigen-dot.R

Defines functions .RandomGaussianEigen

#' Generate Random Variates from the Gaussian Distribution
#' (Eigen Decomposition)
#'
#' @author Ivan Jacob Agaloos Pesigan
#'
#' @param Z Numeric matrix.
#'   `n` by `k` matrix of independent random variates
#'   from the standard univariate normal distribution
#'   \eqn{\mathbf{Z}}.
#' @param eigen Object.
#'   Result of [eigen()].
#'
#' @return Numeric matrix.
#'
#' @family Random Gaussian Functions
#' @keywords randomGaussian random eigen internal
#' @noRd
.RandomGaussianEigen <- function(Z,
                                 eigen) {
  return(
    Z %*% (
      t(eigen$vectors) * sqrt(
        pmax(
          eigen$values,
          0
        )
      )
    )
  )
}

Try the betaMC package in your browser

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

betaMC documentation built on June 24, 2024, 9:08 a.m.