[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.

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.22236173  1.6222158
#>  [2,]  1.95200203  4.6877981
#>  [3,] -1.35822718  0.1272450
#>  [4,]  1.22505352  1.3151341
#>  [5,]  0.07845735  1.6738934
#>  [6,] -1.29940004  0.5256890
#>  [7,] -1.00454508  2.6415933
#>  [8,]  3.36107847  2.8821177
#>  [9,] -1.11056042 -0.4423897
#> [10,]  1.48137081  2.3185059
#> 

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

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

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