rWishart (version 0.1.1)

rSingularWishart: Random Singular Wishart Matrix

Description

Generate n random matrices, distributed according to the Wishart distribution with parameters Sigma and df, W_p(Sigma, df).

Usage

rSingularWishart(n, df, Sigma, covariance = FALSE, simplify = "array")

Arguments

n

integer: the number of replications.

df

numeric parameter, “degrees of freedom”.

Sigma

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

covariance

logical on whether a covariance matrix should be generated

simplify

logical or character string; should the result be simplified to a vector, matrix or higher dimensional array if possible? For sapply it must be named and not abbreviated. The default value, TRUE, returns a vector or matrix if appropriate, whereas if simplify = "array" the result may be an array of “rank” (\(=\)length(dim(.))) one higher than the result of FUN(X[[i]]).

Value

A numeric array of dimension p * p * n, where each array is a positive semidefinite matrix, a realization of the Wishart distribution W_p(Sigma, df)

Details

If X_1, ..., X_m is a sample of m independent multivariate Gaussians with mean vector 0, and covariance matrix Sigma, the distribution of M = X'X is W_p(Sigma, m).

References

Uhlig, Harald. 1994. <U+201C>On Singular Wishart and Singular Multivariate Beta Distributions.<U+201D> The Annals of Statistics 22 (1): 395<U+2013>405. doi:10.1214/aos/1176325375.

Examples

Run this code
# NOT RUN {
rSingularWishart(2, 5, diag(1, 20))
# }

Run the code above in your browser using DataLab