Inverse computation with a starting guess
2 views (last 30 days)
Show older comments
Shlok Vaibhav Singh on 28 Mar 2023
Commented: Shlok Vaibhav Singh on 17 Apr 2023
I am runinng that uses a for loop where in each iteration, an inverse of a 1000x1000 matrix is being computed which is slowing the loop. It is not possible to use A\b form since i explicitly need the inverse matrix, so I am using inv(A).
But there is an additional piece of information, that is, in each for loop iteration, i am changing a parameter slightly, that alters A by small amounts, hence the inverse in iteration should be close to the inverse in previous iteration. Is it possible to provide the last inverse as a starting point or guess for the inverse computation in matlab? I dont see such a possiblity using inv(A), but if it can be done, it will save me a lot of time.
John D'Errico on 28 Mar 2023
It is often the case that someone THINKs they need a matrix inverse, yet they don't. And since you don't know if you can do this computation, that makes it entirely more likely you may not actually really need a matrix inverse.
Anyway, having a previous matrix inverse will not generally help you, although that too is difficult to know. For example IF the change from one matrix to the next was a simple rank 1 update, then yes, there is a tool that can be used, the Sherman-Morrison-Woodbury formula.
Depending if the change is a rank 1 update, or a higher rank update, there are variations on the formula.
But honestly, if you won't tell us what the perturbations to your matrix entail, and you won't tell us why it is that you think you need the matrix inverse, is there a good way for us to know how to help you?
Find more on Resizing and Reshaping Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!