@diwish |

Inverse Wishart probability density.

Syntax: @diwish(X, S, n)

@diwishc(X, S, n)

@diwishi(X, S, n)

@diwishic(X, S, n)

X: sym,

S: sym, matrix,

n: number,

Return: number

Evaluate the inverse Wishart distribution density function for sym values of X, and .

The inverse Wishart density is given by

where and are symmetric matrices, and .

There are four different forms of the density evaluation function, corresponding to different ways of specifying . The forms are distinguished by different suffixes that are applied to the base “@dwish” command and how they change the interpretation of the S matrix argument:

@diwish | “” | Supply . |

@diwishc | “c” | Supply the Cholesky decomposition of . This form is more efficient when performing multiple draws from the same distribution (compute the Cholesky once, but sample many times). |

@diwishi | “i” | Supply . This form is more efficient than explicitly inverting to supply . |

@diwishic | “ic” | Supply the Cholesky decomposition of . This form combines the efficiencies of the Cholesky and inverse forms. |

Note that if is an inverse Wishart random variable, then follows a Wishart distribution:

Examples

= @diwish(@identity(3), @identity(3), 5)

returns 0.00018....

Cross-references