bppnnls | R Documentation |
Use the BPP algorithm to get the nonnegative least squares solution. Regular
NNLS problem is described as optimizing \min_{x\ge0}||CX - B||_F^2
where C
and B
are given and X
is to be solved.
bppnnls
takes C
and B
as input. bppnnls_prod
takes
C^\mathsf{T}C
and C^\mathsf{T}B
as
input to directly go for the intermediate step of BPP algorithm. This can be
useful when the dimensionality of C
and B
is large while
pre-calculating C^\mathsf{T}C
and C^\mathsf{T}B
is cheap.
bppnnls(C, B, nCores = 2L)
bppnnls_prod(CtC, CtB, nCores = 2L)
C |
Input dense |
B |
Input |
nCores |
The number of parallel tasks that will be spawned.
Default |
CtC |
The |
CtB |
The |
The calculated solution matrix in dense form.
set.seed(1)
C <- matrix(rnorm(250), nrow = 25)
B <- matrix(rnorm(375), nrow = 25)
res1 <- bppnnls(C, B)
dim(res1)
res2 <- bppnnls_prod(t(C) %*% C, t(C) %*% B)
all.equal(res1, res2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.