inverse-wishart: Inverse Wishart Distribution

inverse-wishartR Documentation

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)

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.

Details

The inverse Wishart distribution has density function

det(Sigma)^(-(nu+p+1)/2) * exp(-trace(solve(Sigma, S))) / (2^(nu * p / 2) * det(Sigma)^(nu / 2) * Gamma(nu/2, p))

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.

Author(s)

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

See Also

dWishart, rWishart, NormalInverseWishartPrior


Boom documentation built on Nov. 10, 2022, 5:56 p.m.

Related to inverse-wishart in Boom...