8000 Inverse of singular matrix. Should be error but in fact not. · Issue #10471 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content
Inverse of singular matrix. Should be error but in fact not. #10471
Closed
@noob-saibot

Description

@noob-saibot

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0