Inversion of ill Contioned Matrices

In my code I have to take inversion of matrices at a certain point. When I am trying to take the inverse of ill conditioned matrices, I am getting a weird result.
I am not trying to solve equations. I have to take inverse of a matrix, as part of a similarity measure process. I was trying to take the inverse directly, but it was being scaled badly and when I tried to multiply the inverse with the matrix itself, I was nowhere near an Identity matrix. I even tried Singular Value Decomposition (SVD) but no luck. To get a good answer I need to be as close as possible to the inverse as possible.
[U,S,V] = svd(C1);
S1 = zeros(16,16);
for j = 1:16
if S(j,j) ~= 0
S1(j,j) = 1/S(j,j);
end
end
C1_1 = V*S1*transpose(U);
C1*C1_1 was nowhere equal to identity
Can anyone suggest me a method about how to take inversion of ill conditioned matrices other than SVD. Thanks in advance.

1 件のコメント

John D'Errico
John D'Errico 2011 年 2 月 23 日
I don't even know from this example if C1 is a square matrix!!!!!!! Note that if C1 is not square, then it would NEVER result in an identity.

サインインしてコメントする。

回答 (3 件)

Jan
Jan 2011 年 2 月 24 日

2 投票

Have you tried Rump's INTLab?
Alain Barraud has publsihed some methods for accurate linear algebra also: http://www.mathworks.com/matlabcentral/fileexchange/10668-a-forward-stable-linear-solver
Andrew Newell
Andrew Newell 2011 年 2 月 23 日

0 投票

If you have the Symbolic Toolbox, you could try variable precision arithmetic:
C1 = vpa(C1);
C1_1 = inv(C1);
EDIT: If you don't have it, you could try downloading Multiple Precision Toolbox for MATLAB from the File Exchange and do the same thing with mp in place of vpa. I haven't used this toolbox myself, but judging by the list of functions you'll probably want to do this:
C1 = mp(C1);
C1_1 = inv(C1);

2 件のコメント

Harsha
Harsha 2011 年 2 月 23 日
I'm sorry but can you be a bit clearer.
Andrew Newell
Andrew Newell 2011 年 2 月 24 日
I have added explicit commands above, but they're just guesses. You'll have to click on the link, download the package, and read the documentation.

サインインしてコメントする。

Harsha
Harsha 2011 年 2 月 23 日

0 投票

I don't think I have the symbolic tool box, do you have any other suggestions by chance.

1 件のコメント

Andrew Newell
Andrew Newell 2011 年 2 月 23 日
See above. This Answer should really be a Comment.

サインインしてコメントする。

質問済み:

2011 年 2 月 23 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by