Closed
Description
Hello.
I've got strange behavior for experiments. I'm working with matrix (for example b) that in result of multiplying b.T * b should be singular matrix and for inverse method should be arisen error like numpy.linalg.linalg.LinAlgError: Singular matrix. But result was high/low values.
Code below:
>>> b = np.matrix([[1,1,0], [1,0,1], [1,1,0]])
>>> b
matrix([[1, 1, 0],
[1, 0, 1],
[1, 1, 0]])
>>> np.linalg.inv(b.T * b)
matrix([[ 4.50359963e+15, -4.50359963e+15, -4.50359963e+15],
[-4.50359963e+15, 4.50359963e+15, 4.50359963e+15],
[-4.50359963e+15, 4.50359963e+15, 4.50359963e+15]])
How can be avoided this behavior?
Tests on:
win10, Python 3.5.4, numpy version '1.14.0'.
ubuntu 16.04, Python 3.5.2, numpy version '1.13.3' and '1.14.0'.
PS. I've checked via wolfram and R it's real singular matrix.