dmvnorm: Density of the multivariate normal and t distributions

View source: R/dmvnorm.R

Density of the multivariate normal and t distributionsR Documentation

Density of the multivariate normal and t distributions

Description

Density of the multivariate normal and t distributions.

Usage

dmvnorm(x, mu, sigma, logged = FALSE) 
dmvt(x, mu, sigma, nu, logged = FALSE) 

Arguments

x

A numerical matrix with the data. The rows correspond to observations and the columns to variables.

mu

The mean vector.

sigma

The covariance matrix.

nu

The degrees of freedom for the multivariate t distribution.

logged

Should the logarithm of the density be returned (TRUE) or not (FALSE)?

Details

The (log) density of the multivariate normal distribution is calculated for given mean vector and covariance matrix.

Value

A numerical vector with the density values calculated at each vector (row of the matrix x).

Author(s)

Michail Tsagris

R implementation and documentation: Michail Tsagris <mtsagris@uoc.gr> and Manos Papadakis <papadakm95@gmail.com>.

References

Kanti V. Mardia, John T. Kent and John M. Bibby (1979). Multivariate analysis. Academic Press, London.

See Also

rmvnorm, rmvt, mvnorm.mle, iag.mle

Examples

x <- matrnorm(100, 20)
mu <- colmeans(x)
s <- cova(x)
a1 <- dmvnorm(x, mu, s) 
a2 <- dmvt(x, mu, s, 1)
x <- NULL 

Rfast documentation built on Nov. 9, 2023, 5:06 p.m.