Multivariate t distribution
mvt.RdDensity and and random generation for the multivariate t distribution
Arguments
- x
vector or matrix of quantiles
- mu
vector or matrix of location parameters (mean if
df> 1)- Sigma
positive definite scale matrix (proportional to the covariance matrix if
df> 2)- df
degrees of freedom; must be positive
- log
logical; if
TRUE, densities \(p\) are returned as \(\log(p)\).- n
number of random values to return.
Details
This implementation of dmvt allows for automatic differentiation with RTMB.
Note: for df \(\le 1\) the mean is undefined, and for df \(\le 2\) the covariance is infinite.
For df > 2, the covariance is df/(df-2) * Sigma.
$$f(\mathbf{x};\,\boldsymbol{\mu},\Sigma,\nu) = \frac{\Gamma((\nu+d)/2)}{\Gamma(\nu/2)\,(\nu\pi)^{d/2}\,|\Sigma|^{1/2}} \left(1 + \frac{(\mathbf{x}-\boldsymbol{\mu})^\top \Sigma^{-1}(\mathbf{x}-\boldsymbol{\mu})}{\nu}\right)^{-(\nu+d)/2},$$ where \(d\) is the dimension.