exception - In python numpy least squares, why a singular normal matrix does NOT raise LinAlgError? -
solving a.x = b least squares. given :
import numpy np a=[[1,0],[0,0]] b=[1,0] x=np.linalg.lstsq(a, b) # x = 1/(at.a) * (at.b) print x[0] # [ 1. 0.]
at.a a, , det(a)=0 --> singular. there infinity of solutions; [1,0] one.
why lstsq doesn't raise np.linalg.linalg.linalgerror ? doc says "if computation not converge.". not case ?
does have simple example exception raised lstsq ?
Comments
Post a Comment