rmt: Multivariate-t random deviates

View source: R/random.R

rmtR Documentation

Multivariate-t random deviates

Description

Random number generation from the multivariate-t distribution.

Usage

rmt(n = 1, mean = rep(0, nrow(Sigma)), Sigma = diag(length(mean)), eta = .25)

Arguments

n

the number of samples requested

mean

a vector giving the means of each variable

Sigma

a positive-definite covariance matrix

eta

shape parameter (must be in [0,1/2)). Default value is 0.25

Details

The function rmt is an interface to C routines, which make calls to subroutines from LAPACK. The matrix decomposition is internally done using the Cholesky decomposition. If Sigma is not non-negative definite then there will be a warning message.

This parameterization of the multivariate-t includes the normal distribution as a particular case when eta = 0.

Value

If n = 1 a vector of the same length as mean, otherwise a matrix of n rows of random vectors.

References

Devroye, L. (1986). Non-Uniform Random Variate Generation. Springer-Verlag, New York.

See Also

rt

Examples

# covariance matrix
Sigma <- matrix(c(10,3,3,2), ncol = 2)
Sigma

# generate the sample
y <- rmt(n = 1000, Sigma = Sigma)

# scatterplot of a random bivariate t sample with mean vector
# zero and covariance matrix 'Sigma'
par(pty = "s")
plot(y, xlab = "", ylab = "")
title("bivariate t sample (eta = 0.25)", font.main = 1)

MVT documentation built on Feb. 16, 2023, 8:29 p.m.

Related to rmt in MVT...