Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

dmvnorm

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@yahoo.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

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

A Collection of Efficient and Extremely Fast R Functions

v2.0.1
GPL (>= 2.0)
Authors
Manos Papadakis, Michail Tsagris, Marios Dimitriadis, Stefanos Fafalios, Ioannis Tsamardinos, Matteo Fasiolo, Giorgos Borboudakis, John Burkardt, Changliang Zou, Kleanthi Lakiotaki and Christina Chatzipantsiou.
Initial release
2020-09-13

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.