Speedups for Wishart model

With all respect isn’t that goodmattg refering to the inverse of the Cholesky decomposition of the
Wishart distribution, also called inverse-Wishart? And isn’t the inverse of a triangular matrix easy solved
by backward substitution as recommended here?
https://stackoverflow.com/questions/25662643/what-is-the-way-to-invert-a-triangular-matrix-in-r

You don’t need much. I’m an admitted matrix amateur!

Apparently it is, hence Ben’s chol2inv. We’ll get that exposed in Stan for the next release so it’s a built-in.

Any idea when this will get exposed to Stan?

Btw, I’m getting this warning

and, yes, it’s exactly what I want in this case!

There was a longstanding issue for this that was literally a 3-minute fix.

However this will need docs before merging, so if anyone wants to write a few lines for the user docs, that would be great. I am slow with docs and quite busy right now, so would appreciate any help.

It can probably be added to the Cholesky decompose subsubsection in https://mc-stan.org/docs/2_25/functions-reference/linear-algebra-functions-and-solvers.html
Nothing fancy, just a short description.

1 Like

It was intended to be the same as chol2inv in R / LAPACK / everything else, except that in Stan Cholesky factors are lower triangular rather than upper triangular.