Learn R Programming

MSBVAR (version 0.9-2)

ldwishart: Log density for a Wishart variate

Description

Computes log density for a Wishart random variable.

Usage

ldwishart(W, v, S)

Arguments

W
Wishart variate for which the log density is to be computed
v
degrees of freedom for the Wishart variate
S
scale factor for the Wishart variate (typically the inverse covariance if you are working with a multivariate random normal setup

Value

$W$ with mean $S$ and degrees of freedom $v$.

Details

Computes the log density for a Wishart variate with mean $S$ and degrees of freedom $v$. Special care has been taken to avoid underflow in the computation.

See Also

rwishart

Examples

Run this code
x <- matrix(rnorm(100), 50, 2)
XX <- crossprod(x)
ldwishart(solve(XX), 50, diag(2))

Run the code above in your browser using DataLab