Learn R Programming

CholWishart (version 1.1.4)

rCholWishart: Cholesky Factor of Random Wishart Distributed Matrices

Description

Generate n random matrices, distributed according to the Cholesky factorization of a Wishart distribution with parameters Sigma and df, \(W_p(Sigma, df)\) (known as the Bartlett decomposition in the context of Wishart random matrices).

Usage

rCholWishart(n, df, Sigma)

Value

a numeric array, say R, of dimension

\(p \times p \times n\), where each R[,,i] is a Cholesky decomposition of a sample from the Wishart distribution \(W_p(Sigma, df)\). Based on a modification of the existing code for the rWishart function.

Arguments

n

integer sample size.

df

numeric parameter, "degrees of freedom".

Sigma

positive definite \(p \times p\) "scale" matrix, the matrix parameter of the distribution.

References

Anderson, T. W. (2003). An Introduction to Multivariate Statistical Analysis (3rd ed.). Hoboken, N. J.: Wiley Interscience.

Mardia, K. V., J. T. Kent, and J. M. Bibby (1979) Multivariate Analysis, London: Academic Press.

A. K. Gupta and D. K. Nagar 1999. Matrix variate distributions. Chapman and Hall.

See Also

rWishart, rInvCholWishart

Examples

Run this code
# How it is parameterized:
set.seed(20180211)
A <- rCholWishart(1L, 10, 3 * diag(5L))[, , 1]
A
set.seed(20180211)
B <- rInvCholWishart(1L, 10, 1 / 3 * diag(5L))[, , 1]
B
crossprod(A) %*% crossprod(B)

set.seed(20180211)
C <- chol(stats::rWishart(1L, 10, 3 * diag(5L))[, , 1])
C

Run the code above in your browser using DataLab