dist.Inverse.Wishart.Cholesky {LaplacesDemon}  R Documentation 
Inverse Wishart Distribution: Cholesky Parameterization
Description
These functions provide the density and random number generation for the inverse Wishart distribution with the Cholesky parameterization.
Usage
dinvwishartc(U, nu, S, log=FALSE)
rinvwishartc(nu, S)
Arguments
U 
This is the uppertriangular 
nu 
This is the scalar degrees of freedom, 
S 
This is the symmetric, positivesemidefinite

log 
Logical. If 
Details
Application: Continuous Multivariate
Density:
p(\theta) = (2^{\nu k/2} \pi^{k(k1)/4} \prod^k_{i=1} \Gamma(\frac{\nu+1i}{2}))^{1} \textbf{S}^{nu/2} \Omega^{(nuk1)/2} \exp(\frac{1}{2} tr(\textbf{S} \Omega^{1}))
Inventor: John Wishart (1928)
Notation 1:
\Sigma \sim \mathcal{W}^{1}_{\nu}(\textbf{S}^{1})
Notation 2:
p(\Sigma) = \mathcal{W}^{1}_{\nu}(\Sigma  \textbf{S}^{1})
Parameter 1: degrees of freedom
\nu
Parameter 2: symmetric, positivesemidefinite
k \times k
scale matrix\textbf{S}
Mean:
E(\Sigma) = \frac{\textbf{S}}{\nu  k  1}
Variance:
Mode:
mode(\Sigma) = \frac{\textbf{S}}{\nu + k + 1}
The inverse Wishart distribution is a probability distribution defined on
realvalued, symmetric, positivedefinite matrices, and is used as the
conjugate prior for the covariance matrix, \Sigma
, of a
multivariate normal distribution. In this parameterization,
\Sigma
has been decomposed to the uppertriangular Cholesky
factor \textbf{U}
, as per chol
. The
inverseWishart density is always finite, and the integral is always
finite. A degenerate form occurs when \nu < k
.
In practice, \textbf{U}
is fully unconstrained for proposals
when its diagonal is logtransformed. The diagonal is exponentiated
after a proposal and before other calculations. Overall, the
Cholesky parameterization is faster than the traditional
parameterization. Compared with dinvwishart
, dinvwishartc
must additionally matrixmultiply the Cholesky back to the covariance
matrix, but it does not have to check for or correct the covariance
matrix to positivesemidefiniteness, which overall is slower. Compared
with rinvwishart
, rinvwishartc
must additionally
calculate a Cholesky decomposition, and is therefore slower.
The inverse Wishart prior lacks flexibility, having only one parameter,
\nu
, to control the variability for all k(k + 1)/2
elements. Popular choices for the scale matrix \textbf{S}
include an identity matrix or sample covariance matrix. When the model
sample size is small, the specification of the scale matrix can be
influential.
The inverse Wishart distribution has a dependency between variance and correlation, although its relative for a precision matrix (inverse covariance matrix), the Wishart distribution, does not have this dependency. This relationship becomes weaker with more degrees of freedom.
Due to these limitations (lack of flexibility, and dependence between
variance and correlation), alternative distributions have been
developed. Alternative distributions that are available here include the
inverse matrix gamma (dinvmatrixgamma
), Scaled Inverse
Wishart (dsiw
) and HuangWand (dhuangwand
).
HuangWand is recommended.
Value
dinvwishartc
gives the density and
rinvwishartc
generates random deviates.
References
Wishart, J. (1928). "The Generalised Product Moment Distribution in Samples from a Normal Multivariate Population". Biometrika, 20A(12), p. 32–52.
See Also
chol
,
Cov2Prec
,
dhuangwand
,
dinvmatrixgamma
,
dmvn
,
dmvnc
,
dmvtc
,
dsiw
,
dwishart
,
dwishartc
, and
dyangbergerc
.
Examples
library(LaplacesDemon)
Sigma < matrix(c(2,.3,.3,4),2,2)
U < chol(Sigma)
x < dinvwishartc(U, 3, matrix(c(1,.1,.1,1),2,2))
x < rinvwishartc(3, matrix(c(1,.1,.1,1),2,2))