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

Defines functions .RandomGaussianSVD

#' Generate Random Variates from the Gaussian Distribution
#' (Singular Value 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 svd Object.
#'   Result of [svd()].
#'
#' @return Numeric matrix.
#'
#' @family Random Gaussian Functions
#' @keywords randomGaussian random svd internal
#' @noRd
.RandomGaussianSVD <- function(Z,
                               svd) {
  return(
    Z %*% svd$u %*% (
      t(svd$v) * sqrt(
        pmax(
          svd$d,
          0
        )
      )
    )
  )
}

Try the semmcci package in your browser

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

semmcci documentation built on June 22, 2024, 7:20 p.m.