lsNMF-nmf: Multiplicative Updates for LS-NMF

Description Usage Arguments Value References Examples

Description

Implementation of the updates for the LS-NMF algorithm from Wang et al. (2006).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
nmf_update.lsnmf(i, X, object, weight, eps = 10^-9, ...)

wrss(object, X, weight = 1, ...)

nmfAlgorithm._lsNMF(
  ...,
  .stop = NULL,
  maxIter = nmf.getOption("maxIter") %||% 2000,
  weight,
  eps = 10^-9,
  stationary.th = .Machine$double.eps,
  check.interval = 5 * check.niter,
  check.niter = 10L
)

Arguments

i

current iteration

X

target matrix

object

current NMF model

weight

value for S, i.e. the weights that are applied to each entry in X by X * weight (= entry wise product). Weights are usually specified as a matrix of the same dimension as X (e.g. uncertainty estimates for each measurement), but may also be passed as a vector, in which case the standard rules for entry wise product between matrices and vectors apply (e.g. recycling elements).

Null weights can be used to handle missing values in the target matrix. In particular, using weight=NA cancels out all missing values (see examples).

eps

small number passed to the standard euclidean-based NMF updates (see nmf_update.euclidean).

...

extra arguments (not used)

.stop

specification of a stopping criterion, that is used instead of the one associated to the NMF algorithm. It may be specified as:

  • the access key of a registered stopping criterion;

  • a single integer that specifies the exact number of iterations to perform, which will be honoured unless a lower value is explicitly passed in argument maxIter.

  • a single numeric value that specifies the stationnarity threshold for the objective function, used in with nmf.stop.stationary;

  • a function with signature (object="NMFStrategy", i="integer", y="matrix", x="NMF", ...), where object is the NMFStrategy object that describes the algorithm being run, i is the current iteration, y is the target matrix and x is the current value of the NMF model.

maxIter

maximum number of iterations to perform.

stationary.th

maximum absolute value of the gradient, for the objective function to be considered stationary.

check.interval

interval (in number of iterations) on which the stopping criterion is computed.

check.niter

number of successive iteration used to compute the stationnary criterion.

Value

updated object object

References

Wang G, Kossenkov AV, Ochs MF (2006). “LS-NMF: a modified non-negative matrix factorization algorithm utilizing uncertainty estimates.” _BMC bioinformatics_, *7*, 175. ISSN 1471-2105, doi: 10.1186/1471-2105-7-175 (URL: https://doi.org/10.1186/1471-2105-7-175).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# Handling missing values in data
x <- rmatrix(100, 20)
NA_values <- sample(length(x), 5)
x[ 1 ] <- NA

# Classic Lee does not work on this
try({
res <- nmf(x, 2, 'lee')
anyNA(res) # 3 means NA values in basis and coef matrix
})

# LS-NMF handles missing values by cancelling them with null weights
res <- nmf(x, 2, 'ls-nmf', .opt='v')
anyNA(res)

renozao/NMF documentation built on June 14, 2020, 9:35 p.m.