rmtd | R Documentation |
t
DistributionProduces one or more samples from the multivariate (p
variables) t
distribution (MTD)
with degrees of freedom nu
, mean vector mu
and
correlation matrix Sigma
.
rmtd(n, nu, mu, Sigma, tol = 1e-6)
n |
integer. Number of observations. |
nu |
numeric. The degrees of freedom. |
mu |
length |
Sigma |
symmetric, positive-definite square matrix of order |
tol |
tolerance for numerical lack of positive-definiteness in Sigma (for |
A sample from a MTD with parameters \nu
, \boldsymbol{\mu}
and \Sigma
can be generated using:
\displaystyle{\mathbf{X} = \boldsymbol{\mu} + \mathbf{Y} \sqrt{\frac{\nu}{u}}}
where Y
is a random vector distributed among a centered Gaussian density
with covariance matrix \Sigma
(generated using mvrnorm
)
and u
is distributed among a Chi-squared distribution with \nu
degrees of freedom.
A matrix with p
columns and n
rows.
Pierre Santagostini, Nizar Bouhlel
S. Kotz and Saralees Nadarajah (2004), Multivariate t
Distributions and Their Applications, Cambridge University Press.
dmtd
: probability density of a MTD.
estparmtd
: estimation of the parameters of a MTD.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.