Learn R Programming

oeli (version 0.5.2)

dmvnorm: Compute density of multivariate normal distribution

Description

This function computes the density of a multivariate normal distribution.

Usage

dmvnorm(x, mean, Sigma, log = FALSE)

Value

A numeric, the density value.

Arguments

x

A numeric, a quantile vector of length p.

mean

A numeric, the mean vector of length p.

Sigma

A matrix, the covariance matrix of dimension p x p.

log

A logical, if TRUE the logarithm of the density value is returned. By default, log = FALSE.

Examples

Run this code
x <- c(0, 0)
mean <- c(0, 0)
Sigma <- diag(2)
dmvnorm(x = x, mean = mean, Sigma = Sigma)
dmvnorm(x = x, mean = mean, Sigma = Sigma, log = TRUE)

Run the code above in your browser using DataLab