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:$$\begin{array}{l} \min \|Y - X K\|_F\ \mbox{s.t. } K>=0 \end{array}$$
where $Y$ and $X$ are two real matrices of dimension $n \times p$ and $n \times r$ respectively, and $\|.\|_F$ is 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
solve
function. If pseudo=TRUE
the
algorithm usK
that indicates which
element is positive.