rWishart (version 0.1.1)

wishartTest: Test if Matrix is a Wishart Matrix

Description

Given a random Wishart matrix, B, from W_p(Sigma, df) and independent random vector a, then (a' B a) / (a' Sigma a) is chi-squared with df degrees of freedom.

Usage

wishartTest(WishMat, Sigma, vec = NULL)

Arguments

WishMat

random Wishart Matrix from W_p(Sigma, df)

Sigma

Covariance matrix for W_p(Sigma, df)

vec

independent random vector

Value

A chi-squared random variable with df degrees of freedom.

Examples

Run this code
# NOT RUN {
wishartTest(rWishart(1, 5, diag(1, 20), simplify = FALSE)[[1]], diag(1, 20))
# }

Run the code above in your browser using DataLab