Learn R Programming

Boom (version 0.9.15)

inverse-wishart: Inverse Wishart Distribution

Description

Density for the inverse Wishart distribution.

Usage

dInverseWishart(Sigma, sum.of.squares, nu, logscale = FALSE,
                log.det.sumsq = log(det(sum.of.squares)))

InverseWishartPrior(variance.guess, variance.guess.weight)

Value

dInverseWishart returns the scalar density (or log density) at the specified value. This function is not vectorized, so only one random variable (matrix) can be evaluated at a time.

InverseWishartPrior returns a list that encodes the parameters of the distribution in a format expected by underlying C++ code.

Arguments

Sigma

Argument (random variable) for the inverse Wishart distribution. A positive definite matrix.

nu

The "degrees of freedom" parameter of the inverse Wishart distribution. The distribution is only defined for nu >= nrow(Sigma) - 1.

sum.of.squares

A positive definite matrix. Typically this is the sum of squares that is the sufficient statistic for the inverse Wishart distribution.

logscale

Logical. If TRUE then the density is returned on the log scale. Otherwise the density is returned on the density scale.

log.det.sumsq

The log determinant of sum.of.squares. If this function is to be called many times then precomputing the log determinant can save considerable compute time.

variance.guess

A prior guess at the value of the variance matrix the prior is modeling.

variance.guess.weight

A positive scalar indicating the number of observations worth of weight to place on variance.guess.

Author

Steven L. Scott steve.the.bayesian@gmail.com

Details

The inverse Wishart distribution has density function $$ \frac{|Sigma|^{-\frac{\nu + p + 1}{2}} \exp(-tr(\Sigma^{-1}S) / 2)}{ 2^{\frac{\nu p}{2}}|\Sigma|^{\frac{\nu}{2}}\Gamma_p(\nu / 2)}% $$

See Also

dWishart, rWishart, NormalInverseWishartPrior