This is the workhorse function for the higher-level
fcnnls, which implements the fast
nonnegative least-square algorithm for multiple
right-hand-sides from Van Benthem et al. (2004) to
solve the following problem:
min ||Y - X K||_F, s.t. K>=0
Xare two real matrices of dimension
n x pand
n x rrespectively, and
|.|_Fis the Frobenius norm.
The algorithm is very fast compared to other approaches, as it is optimised for handling multiple right-hand sides.
.fcnnls(x, y, verbose = FALSE, pseudo = FALSE, eps = 0)
pseudo=FALSE) the algorithm uses Gaussian elimination to solve the successive internal linear problems, using the
pseudo=TRUEthe algorithm uses Moore-Penrose generalized
corpcorpackage instead of solve.
A list with the following elements:
coefthe fitted coefficient matrix.
Psetthe set of passive constraints, as a logical
matrix of the same size as
K that indicates which
element is positive.
Van Benthem M and Keenan MR (2004). "Fast algorithm for
the solution of large-scale non-negativity-constrained
least squares problems." _Journal of Chemometrics_,
*18*(10), pp. 441-450. ISSN 0886-9383,