The NMF package defines methods for the generic
deviance from the package
stats, to compute
approximation errors between NMF models and matrices,
using a variety of objective functions.
nmfDistance returns a function that computes the
distance between an NMF model and a compatible matrix.
deviance(object, ...) S4 (NMF) `deviance`(object, y, method = c("", "KL", "euclidean"), ...) nmfDistance(method = c("", "KL", "euclidean")) S4 (NMFfit) `deviance`(object, y, method, ...) S4 (NMFStrategy) `deviance`(object, x, y, ...)
ymust have the same dimension as
(x="NMF", y="matrix", ...)that implements a distance measure between an NMF model
xand a target matrix
y, i.e. an objective function to use to compute the deviance. In
deviance, it is passed to
nmfDistanceto get the function that effectively computes the deviance.
deviance returns a nonnegative numerical value
nmfDistance returns a function with least two
arguments: an NMF model and a matrix.
signature(object = "NMF"): Computes the distance between a matrix and the estimate of an
signature(object = "NMFfit"): Returns the deviance of a fitted NMF model.
This method returns the final residual value if the
y is not supplied, or the
approximation error between the fitted NMF model stored
y. In this case, the
computation is performed using the objective function
method if not missing, or the objective of the
algorithm that fitted the model (stored in slot
If not computed by the NMF algorithm itself, the value is
automatically computed at the end of the fitting process
by the function
nmf, using the objective
function associated with the NMF algorithm, so that it
should always be available.
signature(object = "NMFfitX"): Returns the deviance achieved by the best fit object, i.e. the lowest deviance achieved across all NMF runs.
signature(object = "NMFStrategy"): Computes the value of the objective function between the estimate
xand the target