[Numpy-discussion] lstsq underdetermined behaviour

Romesh Abeysuriya romesh.abey at gmail.com
Sun Nov 18 23:03:44 EST 2018


Hi all,

I'm solving an underdetermined system using `numpy.linalg.lstsq` and
trying to track down its behavior for underdetermined systems. In
previous versions of numpy (e.g. 1.14) in `linalg.py` the definition
for `lstsq` calls `dgelsd` for real inputs, which I think means that
the underdetermined system is solved with the minimum-norm solution
(that is, minimizing the norm of the solution vector, in addition to
minimizing the residual). In 1.15 the call is instead to
`_umath_linalg.lstsq_m` and I'm not sure what this actually ends up
doing - does this end up being the same as `dgelsd`? If so, it would
be great if the documentation for  `numpy.linalg.lstsq` stated that it
is returning the minimum-norm solution (as it stands, it reads as
undefined, so in theory I don't think one can rely on any particular
solution being returned for an underdetermined system)

Cheers,
Romesh


More information about the NumPy-Discussion mailing list