Probability density function of multivariate Gaussian distribution
Examples
# 1D example
mvdnorm(x = 2, mu = 1, Sigma = 2)
#> [1] 0.2196956
dnorm(x = 2, mean = 1, sd = sqrt(2))
#> [1] 0.2196956
# Independent 2D example
mvdnorm(x = c(2,2), mu = c(1,1), Sigma = diag(1:2))
#> [1] 0.05315991
prod(dnorm(x = c(2,2), mean = c(1,1), sd = sqrt(1:2)))
#> [1] 0.05315991
# Correlated 2D example
mvdnorm(x = c(2,2), mu = c(1,1), Sigma = matrix(c(2,1,1,2),nrow=2))
#> [1] 0.06584074