rmt: Multivariate Student-t Random Deviates

Description Usage Arguments Details Value References See Also Examples

View source: R/random.R

Description

Random number generation from the multivariate Student-t distribution.

Usage

1
2
rmt(n = 1, center = rep(0, nrow(Scatter)), Scatter = diag(length(center)),
  df = 4)

Arguments

n

the number of samples requested

center

a vector giving the locations of each variable

Scatter

a positive-definite dispersion matrix

df

degrees of freedom (positive, maybe non-integer)

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 Scatter is not non-negative definite then there will be a warning message.

Value

If n = 1 a vector of the same length as center, 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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# dispersion parameters
Scatter <- matrix(c(10,3,3,2), ncol = 2)
Scatter

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

# scatterplot of a random bivariate Student-t sample with center
# vector zero and scale matrix 'Scatter'
par(pty = "s")
plot(y, xlab = "", ylab = "")
title("bivariate Student-t sample (df = 4)", font.main = 1)

heavy documentation built on Oct. 30, 2019, 9:48 a.m.

Related to rmt in heavy...