optimize.nnls

Module Contents

Functions

nnls(A,b) Solve argmin_x || Ax - b ||_2 for x>=0. This is a wrapper
nnls(A, b)

Solve argmin_x || Ax - b ||_2 for x>=0. This is a wrapper for a FORTRAN non-negative least squares solver.

A : ndarray
Matrix A as shown above.
b : ndarray
Right-hand side vector.
x : ndarray
Solution vector.
rnorm : float
The residual, || Ax-b ||_2.

The FORTRAN code was published in the book below. The algorithm is an active set method. It solves the KKT (Karush-Kuhn-Tucker) conditions for the non-negative least squares problem.

Lawson C., Hanson R.J., (1987) Solving Least Squares Problems, SIAM