Improving a badly conditioned matrix

user238469 picture user238469 · Sep 12, 2013 · Viewed 18.5k times · Source

I have a badly conditioned matrix, whose rcond() is close to zero, and therefore, the inverse of that matrix does not come out to be correct. I have tried using pinv() but that does not solve the problem. This is how I am taking the inverse:

X = (A)\(b);

I looked up for a solution to this problem and found this link (last solution) for improving the matrix. The solution there suggests to use this:

A_new = A_old + c*eye(size(A_old));

Where c > 0. So far employing this technique works in making the matrix A better conditioned and the resultant solution looks better. However, I investigated using different values of c and the resultant solution depends on the value of chosen c.

Other than manually investigating for the value of c, is there an automatic way through which I can find the value of c for which I get the best solution?

Answer

Guddu picture Guddu · Sep 12, 2013

In discrete inverse theory, adding a small value c to the diagonal of the matrix A about to be inverted, is called damping the inversion and the small value to be added c is called Marquardt-Levenberg coefficient. Sometimes matrix A has zero or close to zero eigenvalues, due to which the matrix becomes singular; adding a small damping coefficient to the diagonal elements makes it stable. Bigger is the value of c, bigger is the damping, your matrix inversion is more stable, but you are further away from true solution. Smaller is the value of c, smaller is the damping, closer is your inverted matrix to true inverted matrix but it might become unstable. One 'adaptive damping' technique sometimes used is - start with a test value of c, invert the matrix A, then decrease the value of c, do the inversion again and so on. stop when you get weird values in inverted matrix due to A becoming singular again, like really large numbers. I think this doesn't exactly answer your question, but it was too long to put it in a comment.