While trying to compute inverse of a matrix in python using numpy.linalg.inv(matrix), I get singular matrix error. Why does it happen? Has it anything to do with the smallness of the values in the matrix. The numbers in my matrix are probabilities and add up to 1.

有帮助吗?

解决方案

It may very well have to do with the smallness of the values in the matrix.

Some matrices that are not, in fact, mathematically singular (with a zero determinant) are totally singular from a practical point of view, in that the math library one is using cannot process them properly.

Numerical analysis is tricky, as you know, and how well it deals with such situations is a measure of the quality of a matrix library.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top