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))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.
mvtnorm::dmvt, mvtnorm::pmvt, mvtnorm::qmvt, mvtnorm::rmvt
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.3308566 1.3370236
#> [2,] -1.1270206 0.8409425
#> [3,] 3.3641800 1.4620519
#> [4,] 1.9347398 3.8888503
#> [5,] 0.2964536 3.5556578
#> [6,] 5.1773121 5.0947348
#> [7,] -1.3326590 3.5913609
#> [8,] 0.5244520 2.5669033
#> [9,] 1.3997217 -0.6972666
#> [10,] 2.2500461 0.3456535
#>
density(dist, cbind(2, 1))
#> [1] 0.02404305
density(dist, cbind(2, 1), log = TRUE)
#> [1] -3.727909
cdf(dist, 4)
#> [1] 0.7617795
quantile(dist, 0.7)
#> x y
#> [1,] 3.542593 3.542593
quantile(dist, 0.7, kind = "marginal")
#> x y
#> [1,] 2.118859 2.968961