Learn R Programming

mvtnorm (version 0.9-9992)

Mvt: The Multivariate t Distribution

Description

These functions provide information about the multivariate t distribution with non-centrality parameter (or mode) delta, covariance matrix sigma and degrees of freedom df. dmvt gives the density and rmvt generates random deviates.

Usage

rmvt(n, sigma = diag(2), df = 1, delta = rep(0, nrow(sigma)),
     type = c("shifted", "Kshirsagar"), ...)
dmvt(x, delta, sigma, df = 1, log = TRUE,
     type = "shifted")

Arguments

x
Vector or matrix of quantiles. If x is a matrix, each row is taken to be a quantile.
n
Number of observations.
delta
the vector of noncentrality parameters of length n, for type = "shifted" delta specifies the mode.
sigma
Correlation matrix, default is diag(ncol(x)).
df
degree of freedom as integer.
log
Logical; if TRUE, densities d are given as log(d).
type
type of the noncentral multivariate t distribution to be computed. type = "Kshirsagar" corresponds to formula (1.4) in Genz and Bretz (2009) (see also Chapter 5.1 in Kotz and Nadarajah (2004)). This is the
...
additional arguments to rmvnorm, for example method.

Details

For type = "shifted" the following density is implemented $$c(1+(x-\delta)'S^{-1}(x-\delta)/\nu)^{-(\nu+m)/2},$$ where $$c = \Gamma((\nu+m)/2)/((\pi \nu)^{m/2}\Gamma(\nu/2)|S|^{1/2}),$$ here $S$ is a positive definite symmetric matrix (which might be the correlation or the covariance matrix), $delta$ is the non-centrality vector and $\nu$ are the degrees of freedom.

See Also

pmvt and qmvt

Examples

Run this code
dmvt(x=c(0,0), sigma = diag(2))
  x <- rmvt(n=100, sigma = diag(2), df = 3)
  plot(x)

Run the code above in your browser using DataLab