The Multivariate t Distribution
These functions provide information about the multivariate t
distribution with non-centrality parameter (or mode) delta
,
scale matrix sigma
and degrees of freedom df
.
dmvt
gives the density and rmvt
generates random deviates.
rmvt(n, sigma = diag(2), df = 1, delta = rep(0, nrow(sigma)), type = c("shifted", "Kshirsagar"), ...) dmvt(x, delta = rep(0, p), sigma = diag(p), df = 1, log = TRUE, type = "shifted", checkSymmetry = TRUE)
x |
vector or matrix of quantiles. If |
n |
number of observations. |
delta |
the vector of noncentrality parameters of length n, for
|
sigma |
scale matrix, defaults to
|
df |
degrees of freedom. |
log |
|
type |
type of the noncentral multivariate t distribution.
|
checkSymmetry |
logical; if |
... |
additional arguments to |
If X denotes a random vector following a t distribution
with location vector 0 and scale matrix
Sigma (written X ~ t_nu(0,
Sigma)), the scale matrix (the argument
sigma
) is not equal to the covariance matrix Cov(X)
of X. If the degrees of freedom nu (the
argument df
) is larger than 2, then
Cov(X)=Sigma
nu/(nu-2). Furthermore,
in this case the correlation matrix Cor(X) equals
the correlation matrix corresponding to the scale matrix
Sigma (which can be computed with
cov2cor()
). Note that the scale matrix is sometimes
referred to as “dispersion matrix”;
see McNeil, Frey, Embrechts (2005, p. 74).
For type = "shifted"
the density
c(1+(x-δ)'S^{-1}(x-δ)/ν)^{-(ν+m)/2}
is implemented, where
c = Γ((ν+m)/2)/((π ν)^{m/2}Γ(ν/2)|S|^{1/2}),
S is a positive definite symmetric matrix (the matrix
sigma
above), delta is the
non-centrality vector and nu are the degrees of freedom.
df=0
historically leads to the multivariate normal
distribution. From a mathematical point of view, rather
df=Inf
corresponds to the multivariate normal
distribution. This is (now) also allowed for rmvt()
and
dmvt()
.
Note that dmvt()
has default log = TRUE
, whereas
dmvnorm()
has default log = FALSE
.
McNeil, A. J., Frey, R., and Embrechts, P. (2005). Quantitative Risk Management: Concepts, Techniques, Tools. Princeton University Press.
## basic evaluation dmvt(x = c(0,0), sigma = diag(2)) ## check behavior for df=0 and df=Inf x <- c(1.23, 4.56) mu <- 1:2 Sigma <- diag(2) x0 <- dmvt(x, delta = mu, sigma = Sigma, df = 0) # default log = TRUE! x8 <- dmvt(x, delta = mu, sigma = Sigma, df = Inf) # default log = TRUE! xn <- dmvnorm(x, mean = mu, sigma = Sigma, log = TRUE) stopifnot(identical(x0, x8), identical(x0, xn)) ## X ~ t_3(0, diag(2)) x <- rmvt(100, sigma = diag(2), df = 3) # t_3(0, diag(2)) sample plot(x) ## X ~ t_3(mu, Sigma) n <- 1000 mu <- 1:2 Sigma <- matrix(c(4, 2, 2, 3), ncol=2) set.seed(271) x <- rep(mu, each=n) + rmvt(n, sigma=Sigma, df=3) plot(x) ## Note that the call rmvt(n, mean=mu, sigma=Sigma, df=3) does *not* ## give a valid sample from t_3(mu, Sigma)! [and thus throws an error] try(rmvt(n, mean=mu, sigma=Sigma, df=3)) ## df=Inf correctly samples from a multivariate normal distribution set.seed(271) x <- rep(mu, each=n) + rmvt(n, sigma=Sigma, df=Inf) set.seed(271) x. <- rmvnorm(n, mean=mu, sigma=Sigma) stopifnot(identical(x, x.))
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.