Computational Science Asked by Orders on September 30, 2021
Given a positive definite symmetric matrix, what is the fastest algorithm for computing the inverse matrix and its determinant? For problems I am interested in, the matrix dimension is 30 or less.
For problems I am interested in, the matrix dimension is 30 or less.
As WolfgangBangerth notes, unless you have a large number of these matrices (millions, billions), performance of matrix inversion typically isn't an issue.
Given a positive definite symmetric matrix, what is the fastest algorithm for computing the inverse matrix and its determinant?
If speed is an issue, you should answer the following questions:
The standard response to your problem of inverting a small, positive definite matrix and calculating its determinant would be Cholesky decomposition. If $A = LL^{T}$, then $det(A) = prod_{i=1}^{n}l_{ii}^{2}$, and $det(A^{-1}) = prod_{i=1}^{n}l_{ii}^{-2}$.
Assuming $A$ is $n$ by $n$, the Cholesky decomposition can be computed in around $n^{3}/3$ flops, which is about half the cost of an LU decomposition. However, such an algorithm would not be considered "fast". A randomized LU decomposition might be a faster algorithm worth considering if (1) you really do have to factor a large number of matrices, (2) the factorization is really the limiting step in your application, and (3) any error incurred in using a randomized algorithm is acceptable. Your matrices are probably too small for sparse algorithms to be worthwhile, so the only other opportunities for faster algorithms would require additional matrix structure (e.g., banded), or exploiting problem structure (e.g., maybe you can cleverly restructure your algorithm so that you no longer need to calculate a matrix inverse or its determinant). Efficient determinant algorithms are roughly the cost of solving a linear system, to within a constant factor, so the same arguments used for linear systems apply to calculating determinants as well.
Correct answer by Geoff Oxberry on September 30, 2021
Briefly, referencing the Julia documentation on linear algebra subroutines, they note that the Bunch-Kaufman factorization method is more appropriate for symmetric matrices.(old source from NASA) It may go without saying that positive definite matrices are a subset of symmetric matrices, so while Bunch-Kaufman factorization is an improvement, it isn't necessarily the best they can do.
A 2015 matlab user submission entitled "Fast and Accurate Symmetric Positive Definite Matrix Inverse Using Cholesky Decomposition" clearly suggests the Cholesky decomposition, and the RFast package shares that opinion, but another stack exchange conversation suggests that the best method is really application dependent - so if you have the time to benchmark various methods, that would give you a more definitive answer.
Answered by Eric on September 30, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP