fast_dmvnorm_chol_inverse: fast_dmvnorm_chol_inverse

View source: R/mvnorm.R

fast_dmvnorm_chol_inverseR Documentation

fast_dmvnorm_chol_inverse

Description

Compute multivariate Normal density (log-value) evaluated at each row of a given matrix. The function does not check the arguments, use at your own risk.

Usage

fast_dmvnorm_chol_inverse(x, mean, chol_inverse)

Arguments

x

A matrix of size n times d

mean

A vector of size d specifying the mean vector of the multivariate Normal

chol_inverse

A matrix of size d x d specifying the inverse of the upper-triangular Cholesky factor of the covariance matrix of the multivariate Normal, for instance obtained using solve(chol(Sigma))

Value

A vector of n evaluations of the multivariate Normal log-pdf, one for each row of x

Examples

Sigma <- diag(1, 5, 5)
Sigma[1,2] <- Sigma[2,1] <- 0.3
Sigma_chol <- chol(Sigma)
x <- fast_rmvnorm_chol(2, rep(0, 5), Sigma_chol)
fast_dmvnorm_chol_inverse(x, rep(0, 5), solve(Sigma_chol))

pierrejacob/debiasedmcmc documentation built on Aug. 22, 2022, 12:41 a.m.