[SciPy-User] Cholesky problem (I need dtrtrs, not dpotrs)

David Warde-Farley dwf at cs.toronto.edu
Fri Jul 9 18:52:09 EDT 2010


On 2010-07-09, at 12:33 AM, Sturla Molden wrote:

> cx = X - m
>  sqmahal = (tri_solve(cho_factor(S),cx.T).T**2).sum(axis=1)
> 
> This looks almost the same in Python, but the solution with tri_solve (dtrtrs) requires only half as many flops as cho_solve (dpotrs) does. 
> 
> In many statistical applications requiring substantial amount of computation (EM algorithms, MCMC simulation, and the like), computing Mahalanobis distances can be the biggest bottleneck. 

+1 on Mahalanobis calculations being a pain/bottleneck...  And, wow. I did not quite realize the situation was that bad.

David


More information about the SciPy-User mailing list