-
Notifications
You must be signed in to change notification settings - Fork 48
Description
I thought I'd move this conversation out into its own issue since there are quite a few ideas to talk about.
Originally posted by @nsiccha in #439 (comment)
The trace of the product of two (square) matrices can be computed in O(n^2) without computing the O(n^3) matrix product, see e.g. https://en.wikipedia.org/wiki/Trace_(linear_algebra)#Trace_of_a_product.
Yeah, I guess if we're going to be using G^{-1} for this trace product for each θ it's probably worth to invert it directly and use the Kronecker trick.
Furthermore, do we think that Julia is clever enough to reorder this expression:
r' * invG * ∂G∂θᵢ * invG * r? It's in any case unncessary to compute it as it's implemented there. Do thetmp = invG * ronce, then compute thetmp' * ∂G∂θᵢ * tmpin one go - I'm sure there's a function for that.
I'd be quite confident that it wouldn't. A tmp variable is what I used form the SSM-RHMC implementation.