rmtd {mstudentd}R Documentation

Simulate from a Multivariate tt Distribution

Description

Produces one or more samples from the multivariate (pp variables) tt distribution (MTD) with degrees of freedom nu, mean vector mu and correlation matrix Sigma.

Usage

rmtd(n, nu, mu, Sigma, tol = 1e-6)

Arguments

n

integer. Number of observations.

nu

numeric. The degrees of freedom.

mu

length pp numeric vector. The mean vector

Sigma

symmetric, positive-definite square matrix of order pp. The correlation matrix.

tol

tolerance for numerical lack of positive-definiteness in Sigma (for mvrnorm, see Details).

Details

A sample from a MTD with parameters ν\nu, μ\boldsymbol{\mu} and Σ\Sigma can be generated using:

X=μ+Yuν\displaystyle{X = \mu + \frac{Y}{\sqrt{\frac{u}{\nu}}}}

where YY is a random vector distributed among a centered Gaussian density with covariance matrix Σ\Sigma (generated using mvrnorm) and uu is distributed among a Chi-squared distribution with ν\nu degrees of freedom.

Value

A matrix with pp columns and nn rows.

Author(s)

Pierre Santagostini, Nizar Bouhlel

References

S. Kotz and Saralees Nadarajah (2004), Multivariate tt Distributions and Their Applications, Cambridge University Press.

See Also

dmtd: probability density of a MTD.

Examples

nu <- 3
mu <- c(0, 1, 4)
Sigma <- matrix(c(1, 0.6, 0.2, 0.6, 1, 0.3, 0.2, 0.3, 1), nrow = 3)
x <- rmtd(10000, nu, mu, Sigma)
head(x)
dim(x)
mu; colMeans(x)
nu/(nu-2)*Sigma; var(x)


[Package mstudentd version 1.1.1 Index]