[R-pkgs] new package 'nnls'
kate at few.vu.nl
Mon Oct 15 13:41:44 CEST 2007
A new package 'nnls' is now available on CRAN.
The package provides an R interface to the Lawson-Hanson NNLS algorithm
for non-negative least squares that solves the least squares problem A x =
b with the constraint x >= 0.
The Lawson-Hanson NNLS algorithm was published in
Lawson CL, Hanson RJ (1974). Solving Least Squares Problems. Prentice
Hall, Englewood Cliffs, NJ.
Lawson CL, Hanson RJ (1995). Solving Least Squares Problems. Classics in
Applied Mathematics. SIAM, Philadelphia.
and is available as Fortran77 code on Netlib (file lawson-hanson/all). The
'nnls' package interfaces to this code.
Included in the examples section of the function 'nnls' is a test problem
comparing NNLS to the L-BFGS-B method of 'optim' and to the 'solve.QP'
function of the package 'quadprog'. NNLS is shown to be faster and
slightly more accurate than these more general purpose algorithms for the
test problem examined.
I do not have access to S-PLUS or the S-PLUS source, but the help page for
the S-SPLUS function 'nnls.fit' references Lawson and Hanson (1974), and
is probably close to the port here. I have not written any methods for
printing or summaries, and only return the solution x. On request, I can
modify this behavior.
I would be interested in suggestions, bug reports, and other comments.
mail: Department of Physics and Astronomy, Faculty of Sciences
Vrije Universiteit Amsterdam, de Boelelaan 1081
1081 HV Amsterdam, The Netherlands
tel: +31 205987870
fax: +31 205987992
e-mail: kate at nat.vu.nl
More information about the R-packages