The SVD for a large nonsingular square matrix includes a zero. Any ideas what's going on?

3 views (last 30 days)
I have a 100x100 square matrix which is definitely nonsingular: it's lower triangular with 1's along the main diagonal, and many near-zero entries along the lower diagonals. Yet, Matlab has trouble inverting this matrix: some entries in the inverse are very large. When I ask Matlab to take the SVD, all singular values are within an order of magnitude of one, except one singular value is exactly zero.
Has anyone encountered anything like this? I'm afraid I can't provide a short example featuring the same problem, without sharing my entire code.
Edit with more info: The matrix in question is block Toeplitz, if it matters. And not all of the lower triangle values are near zero.
Edit 2: I attached the matrix. At least with 2014b, when I take the SVD, there is one zero.
  2 Comments
John D'Errico
John D'Errico on 10 Feb 2017
Edited: John D'Errico on 10 Feb 2017
It would help if you attach the matrix in question so we can look at it and understand what is happening. You need not attach the code, just the matrix. Put it in a .mat file, and attach that to a comment or to your question (using the paper clip button.)

Sign in to comment.

Accepted Answer

John D'Errico
John D'Errico on 11 Feb 2017
Edited: John D'Errico on 11 Feb 2017
It is not a numerically singular matrix. It is not hugely well conditioned, because the range of singular values is moderately large.
s= svd(Z_T);
min(s)
ans =
8.7465e-06
max(s)
ans =
1.7304
NONE of the singular values are zero. One is just small, certainly not exactly zero. Unless that small singular value was on the order of 1e-16 or so compared to the max singular value, I would not have called it zero. So it has a condition number of a medium size.
cond(Z_T)
ans =
1.9784e+05
Yes, that also indicates that the inverse of this matrix will likely have some large elements in it. Why is that a problem, or unexpected? That happens naturally when you have a matrix with large condition numbers, a symptom of that property.
surf(inv(Z_T),'edgecolor','none')
As you can see from the surface plot, stuff happens down in the corner. It is also highly oscillatory. But I would expect that when looking at the structure of your matrix.
Looking at your matrix, I see the lower triangle is composed of 2x2 blocks, all of which are highly similar.
Z_T(1:10,1:10)
ans =
1 0 0 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0 0 0
0.53414 -0.028622 1 0 0 0 0 0 0 0
-0.026634 0.53619 0 1 0 0 0 0 0 0
-0.04599 0.043309 0.53414 -0.028622 1 0 0 0 0 0
0.038656 -0.050652 -0.026634 0.53619 0 1 0 0 0 0
0.040991 -0.04401 -0.04599 0.043309 0.53414 -0.028622 1 0 0 0
-0.037373 0.047648 0.038656 -0.050652 -0.026634 0.53619 0 1 0 0
-0.038301 0.044272 0.040991 -0.04401 -0.04599 0.043309 0.53414 -0.028622 1 0
0.036398 -0.046272 -0.037373 0.047648 0.038656 -0.050652 -0.026634 0.53619 0 1
So I'm not really surprised to see the oscillations, and I'm certainly not surprised to see large elements in the inverse.
The question is, why is any of this a problem?

More Answers (1)

Jan
Jan on 11 Feb 2017
Edited: Jan on 11 Feb 2017
Data = load(strange_matrix.mat);
A = Data.Z_T;
cond(A)
>> 197838.44
invA = inv(A);
max(abs(invA(:))
>> 13062.68
B = invA * A - eye(size(A));
max(abs(B(:)))
>> 5.98e-12
I cannot see an evidience for Matlab having any "troubles" with inverting this matrix. A is with almost 2e5 not well condioned, but not pathological also. What do you expect?

Categories

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!