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

dist.Multivariate.t

Multivariate t Distribution


Description

These functions provide the density and random number generation for the multivariate t distribution, otherwise called the multivariate Student distribution.

Usage

dmvt(x, mu, S, df=Inf, log=FALSE)
rmvt(n=1, mu, S, df=Inf)

Arguments

x

This is either a vector of length k or a matrix with a number of columns, k, equal to the number of columns in scale matrix S.

n

This is the number of random draws.

mu

This is a numeric vector or matrix representing the location parameter,mu (the mean vector), of the multivariate distribution (equal to the expected value when df > 1, otherwise represented as nu > 1). When a vector, it must be of length k, or must have k columns as a matrix, as defined above.

S

This is a k x k positive-definite scale matrix S, such that S*df/(df-2) is the variance-covariance matrix when df > 2. A vector of length 1 is also allowed (in this case, k=1 is set).

df

This is the degrees of freedom, and is often represented with nu.

log

Logical. If log=TRUE, then the logarithm of the density is returned.

Details

  • Application: Continuous Multivariate

  • Density:

    p(theta) = Gamma[(nu+k)/2] / {Gamma(nu/2)nu^(k/2)pi^(k/2)|Sigma|^(1/2)[1 + (1/nu)(theta-mu)^T*Sigma^(-1)(theta-mu)]^[(nu+k)/2]}

  • Inventor: Unknown (to me, anyway)

  • Notation 1: theta ~ t[k](mu, Sigma, nu)

  • Notation 2: p(theta) = t[k](theta | mu, Sigma, nu)

  • Parameter 1: location vector mu

  • Parameter 2: positive-definite k x k scale matrix Sigma

  • Parameter 3: degrees of freedom nu > 0 (df in the functions)

  • Mean: E(theta) = mu, for nu > 1, otherwise undefined

  • Variance: var(theta) = (nu / (nu - 2))*Sigma, for nu > 2

  • Mode: mode(theta) = mu

The multivariate t distribution, also called the multivariate Student or multivariate Student t distribution, is a multidimensional extension of the one-dimensional or univariate Student t distribution. A random vector is considered to be multivariate t-distributed if every linear combination of its components has a univariate Student t-distribution. This distribution has a mean parameter vector mu of length k, and a k x k scale matrix S, which must be positive-definite. When degrees of freedom nu=1, this is the multivariate Cauchy distribution.

Value

dmvt gives the density and rmvt generates random deviates.

Author(s)

See Also

Examples

library(LaplacesDemon)
x <- seq(-2,4,length=21)
y <- 2*x+10
z <- x+cos(y) 
mu <- c(1,12,2)
S <- matrix(c(1,2,0,2,5,0.5,0,0.5,3), 3, 3)
df <- 4
f <- dmvt(cbind(x,y,z), mu, S, df)
X <- rmvt(1000, c(0,1,2), S, 5)
joint.density.plot(X[,1], X[,2], color=TRUE)

LaplacesDemon

Complete Environment for Bayesian Inference

v16.1.4
MIT + file LICENSE
Authors
Byron Hall [aut], Martina Hall [aut], Statisticat, LLC [aut], Eric Brown [ctb], Richard Hermanson [ctb], Emmanuel Charpentier [ctb], Daniel Heck [ctb], Stephane Laurent [ctb], Quentin F. Gronau [ctb], Henrik Singmann [cre]
Initial release

We don't support your browser anymore

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