PLS_Toolbox Documentation: fastnnls< factdes ffacdes1 >

fastnnls

Purpose

Fast non-negative least squares.

Synopsis

 

[b,xi] = fastnnls(x,y,tol,b0,const,xi);

Description

Solves the equation xb = y subject to the constraint that b is non-negative. The inputs are the matrix of predictor variables x, vector or matrix of predicted variables y. Optional inputs include: tolerance on the size of a regression coefficient that is considered zero (if tol = 0 the default is used tol = max(size(x))*norm(x,1)*eps), tol, initial guess for the regression vectors, b0, and the equality constraints matrix, const, equal in size to b0 and containing a value of NaN to indicate an unconstrained value or any finite value to indicate a constrained value. The optional input xi is the cached inverses output by a previous run of fastnnls (see outputs) or 0 (zero) to disable caching.

The outputs are the non-negatively constrained least squares solution, b, and the cache of x inverses, xi. If input y is a matrix, the result  is the solution for each column of y calculated independently.

If tol is set to 0 or [], the default tolerance will be used. If xi is set to 0, caching will be disabled.

FASTNNLS is fastest when a good estimate of the regression vector b0 is input. This eliminates much of the computation involved in determining which coefficients will be nonzero in the final regression vector. This makes it very useful in alternating least squares routines. Note that the input b0 must be a feasible (i.e. nonnegative) solution.

The FASTNNLS algorithm is based on work by Bro and de Jong, J. Chemo., 11(5), 393-401, 1997.

See Also

lsq2top, mcr, parafac


< factdes ffacdes1 >