Learn R Programming

TFORGE (version 0.1.16)

rsymm_t: Simulate Symmetric Matrices with Multivariate t Elements

Description

Simulate symmetric matrices with elements from a multivariate t distribution.

Usage

rsymm_t(n, mean, df = 1, sigma = diag(length(vech(mean))))

Value

A set of flattened symmetric matrices as a TFORGE_fsm object. See as_fsm().

Arguments

n

Number of matrices to generate.

mean

A symmetric matrix specifying the mean of the distribution.

df

Degrees of freedom for the t distribution.

sigma

The scale parameter matrix for the elements arranged by vech(). sigma is passed to mvtnorm::rmvt() without any transformation.

Details

The function uses Representation A in lin1972chTFORGE to simulate multivariate-t vectors. The mean matrix is vectorised using the vech() function and then used as the mean vector in the mvtnorm::rmvt() function. The scale parameter matrix sigma is passed unchanged to mvtnorm::rmvt(). The covariance of the resulting vectors is sigma * df / (df - 2). Symmetric matrices can be obtained by applying inv_vech() to each simulated vector.

References

Examples

Run this code
rsymm_t(100, mean = matrix(1, nrow = 3, ncol = 3), df = 10, sigma = diag(c(3,2,1,1,1,1)))

Run the code above in your browser using DataLab