dmvnorm: Evaluate density of multivariate Normal

Description Usage Arguments Details Value See Also Examples

View source: R/multivariatenormal.R

Description

Function to evaluate a multivariate Normal density of each row of the given matrix.

Usage

1
dmvnorm(x, mean, covariance)

Arguments

x

is a n x d matrix of real values

mean

is the mean vector

covariance

is the covariance matrix

Details

This function does not check anything (i.e. that the given covariance is PSD). Thus it is faster than functions in standard packages, but more risky.

Value

a vector of n log-density evaluations

See Also

rmvnorm, rmvnorm_cholesky, dmvnorm_cholesky_inverse

Examples

1
2
3
x <- rmvnorm(10, rep(0, 5), diag(1, 5, 5))
dmvnorm(x, rep(-1, 5), diag(2, 5, 5))
# mvtnorm::dmvnorm(x, rep(-1, 5), diag(2, 5, 5), log = T)

pierrejacob/PET documentation built on May 25, 2019, 11:35 p.m.