سؤال

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