逆矩阵的奇异性 [英] Singularity for inverse matrix
本文介绍了逆矩阵的奇异性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
作为数据,我得到一个矩阵A,但是在我的算法中,我需要对其求逆.我要做的是:
As data I get a matrix A but in my algorithm I need to work on its inverse. What I do is:
C = inv(A) + B;
然后在另一行中更新A.在接下来的循环中,对于该算法,我同样需要(更新)逆.等等.在以后的周期中,我得到以下信息:
Then in another line I update A. In the next cycles I also need (updated) A inverse, again for this algorithm. And so on. In the later cycles I get this:
Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 1.425117e-019
或者这个:
Warning: Matrix is singular to working precision.
或者这个:
Warning: Matrix is singular, close to singular or badly scaled. Results may be inaccurate. RCOND = NaN.
您能帮我如何避免这种奇异之处吗?矩阵总是平方的.
Can you help me how to avoid such singularity? Matrix is squared always.
推荐答案
您可以向A添加一些分钟身份矩阵:
You can add some minute identity matrix to A:
A = A + small_coeff * eye(size(A));
以使所得矩阵足够非奇异
so that resulting matrix will be sufficiently non-singular
这篇关于逆矩阵的奇异性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文