deerlab.fnnls#

fnnls(AtA, Atb, tol=None, maxiter=None, verbose=False)[source]#

Fast non-negative least-squares (NNLS) solver.

Solves the problem

\min \Vert b - Ax \Vert^2

where AtA = A^TA and Atb = A^Tb using the fast non-negative least-squares (FNNLS) algorithm [1], [2].

Parameters:
AtAmatrix_like

Matrix A^TA

Atbarray_like

Vector A^Tb

tolfloat scalar

Tolerance used for deciding when elements of x are less than zero. The default is tol = max(shape(AtA))*norm(AtA,1)*eps.

maxiterinteger scalar

Maximum number of iterations. The default is maxiter = 5*max(shape(AtA))

verboseboolean

If set to True, display the iteration details during the optimization.

Returns:
xndarray

Solution vector.

References

[1]

R. Bro, S. De Jong, A Fast Non-Negativity-Constrained Least Squares Algorithm Journal of Chemometrics 11 (1997) 393-401

[2]

Lawson and Hanson, Solving Least Squares Problems Prentice-Hall, 1974.