Singular Matrix
이전 댓글 표시
Hello all!
I am trying to do a left hand inversion (using backslash operator) but I get the following message:
Matrix is singular to working precision. RCOND=NaN
What can I do to avoid this and make the operation? The matrix is 1500x1500 and has a lot of zeros...
Thank you.
답변 (2개)
William
2012년 3월 10일
1 개 추천
The matrix you are working with is not full rank or no independent. This means that some columns or rows within the matrix are functions of others. The best way to figure out which columns or rows are the problems is to delete a row or column and use rank() to see if the number returned is the minimum number of rows or columns. once this is true than you have an independent matrix and the operation should work.
If this doesn't make sense try searching for "Matrix independence" on google
Hope this helps
댓글 수: 5
Venkat R
2012년 10월 12일
Hi William, I am also facing the same problem. But the rank of my current matrix(278x162) is showing as 162. Now how to find the independent matrix?
regards, Venkat
Walter Roberson
2012년 10월 12일
Remove any (278-162) rows, leaving 162, and check the rank again.
Thank you William But still it doesn't work. Actually I am trying to fit Gaussian mix models to this data. The same code works well for a 2x1000 data ! At one particular stage where cholesky factorization function gives this warning/error. The range of my elements is [0 1]. Any other ideas?
regards, Venkat
Walter Roberson
2012년 10월 13일
Please expand on "still it doesn't work"
Venkat R
2012년 10월 14일
Expanding I am using two software packages to compute GMM
1. First one gives (at the Expectation Maximization stage)
Warning: Matrix is singular, close to singular or badly scaled. Results may be inaccurate. RCOND = NaN.
2. The other gives
??? Error using ==> chol Matrix must be positive definite.
Although both the packages work fine for a sample 2x1000 matrix fine.
3. I even tried
[vec,val] = eig(dscr);
val(val<0) = eps;
dscr1 = vec*val*vec';
as mentioned in
But the same 1) and 2) are continuing
regards,
Venkat
카테고리
도움말 센터 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!