[Stable]

The multivariate t-distribution is a generalization of the univariate Student's t-distribution to multiple dimensions. It is commonly used for modeling heavy-tailed multivariate data and in robust statistics.

dist_multivariate_t(df = 1, mu = 0, sigma = diag(1))

Arguments

df

A numeric vector of degrees of freedom (must be positive).

mu

A list of numeric vectors for the distribution location parameter.

sigma

A list of matrices for the distribution scale matrix.

Details

We recommend reading this documentation on pkgdown which renders math nicely. https://pkg.mitchelloharawild.com/distributional/reference/dist_multivariate_t.html

In the following, let \(\mathbf{X}\) be a multivariate t random vector with degrees of freedom df = \(\nu\), location parameter mu = \(\boldsymbol{\mu}\), and scale matrix sigma = \(\boldsymbol{\Sigma}\).

Support: \(\mathbf{x} \in \mathbb{R}^k\), where \(k\) is the dimension of the distribution

Mean: \(\boldsymbol{\mu}\) for \(\nu > 1\), undefined otherwise

Covariance matrix:

$$ \text{Cov}(\mathbf{X}) = \frac{\nu}{\nu - 2} \boldsymbol{\Sigma} $$

for \(\nu > 2\), undefined otherwise

Probability density function (p.d.f):

$$ f(\mathbf{x}) = \frac{\Gamma\left(\frac{\nu + k}{2}\right)} {\Gamma\left(\frac{\nu}{2}\right) \nu^{k/2} \pi^{k/2} |\boldsymbol{\Sigma}|^{1/2}} \left[1 + \frac{1}{\nu}(\mathbf{x} - \boldsymbol{\mu})^T \boldsymbol{\Sigma}^{-1} (\mathbf{x} - \boldsymbol{\mu})\right]^{-\frac{\nu + k}{2}} $$

where \(k\) is the dimension of the distribution and \(\Gamma(\cdot)\) is the gamma function.

Cumulative distribution function (c.d.f):

$$ F(\mathbf{t}) = \int_{-\infty}^{t_1} \cdots \int_{-\infty}^{t_k} f(\mathbf{x}) \, d\mathbf{x} $$

This integral does not have a closed form solution and is approximated numerically.

Quantile function:

The equicoordinate quantile function finds \(q\) such that:

$$ P(X_1 \leq q, \ldots, X_k \leq q) = p $$

This does not have a closed form solution and is approximated numerically.

The marginal quantile function for each dimension \(i\) is:

$$ Q_i(p) = \mu_i + \sqrt{\Sigma_{ii}} \cdot t_{\nu}^{-1}(p) $$

where \(t_{\nu}^{-1}(p)\) is the quantile function of the univariate Student's t-distribution with \(\nu\) degrees of freedom, and \(\Sigma_{ii}\) is the \(i\)-th diagonal element of sigma.

See also

mvtnorm::dmvt, mvtnorm::pmvt, mvtnorm::qmvt, mvtnorm::rmvt

Examples

dist <- dist_multivariate_t(
  df = 5,
  mu = list(c(1, 2)),
  sigma = list(matrix(c(4, 2, 2, 3), ncol = 2))
)
dimnames(dist) <- c("x", "y")
dist
#> <distribution[1]>
#> [1] MVT[2](5)

mean(dist)
#>      x y
#> [1,] 1 2
variance(dist)
#>             x y
#> [1,] 6.666667 5
support(dist)
#> <support_region[1]>
#> [1] R^2
generate(dist, 10)
#> [[1]]
#>                x          y
#>  [1,] -0.4139978  2.2511722
#>  [2,] -0.4349363  2.2960609
#>  [3,] -0.5689304  2.2493811
#>  [4,]  0.6091898  0.9303365
#>  [5,] -1.1564227 -0.7685471
#>  [6,]  0.8924269  2.0400104
#>  [7,] -1.5395597  0.9540251
#>  [8,]  2.3549096 -0.3031727
#>  [9,] -1.6074640 -1.1606220
#> [10,] -2.8442132 -1.6710995
#> 

density(dist, cbind(2, 1))
#> [1] 0.02404305
density(dist, cbind(2, 1), log = TRUE)
#> [1] -3.727909

cdf(dist, 4)
#> [1] 0.7616725

quantile(dist, 0.7)
#>             x        y
#> [1,] 3.542726 3.542726
quantile(dist, 0.7, kind = "marginal")
#>             x        y
#> [1,] 2.118859 2.968961