Computes the estimated target matrix based on a given
NMF model. The estimation depends on the
underlying NMF model. For example in the standard model
V ~ W H, the target matrix is
estimated by the matrix product
W H. In other
models, the estimate may depend on extra
parameters/matrix (cf. Non-smooth NMF in
fitted(object, ...) S4 (NMFstd) `fitted`(object, W, H, ...) S4 (NMFOffset) `fitted`(object, W, H, offset = object@offset) S4 (NMFns) `fitted`(object, W, H, S, ...)
basis(object). It must be compatible with the coefficient matrix used in the computation (i.e. number of columns in
W= number of rows in
coef(object). It must be compatible with the basis matrix used in the computation (i.e. number of rows in
H= number of columns in
smoothing(object)It must be a square matrix compatible with the basis and coefficient matrices used in the computation.
the target matrix estimate as fitted by the model
This function is a S4 generic function imported from
fitted in the package stats. It is
implemented as a pure virtual method for objects of class
NMF, meaning that concrete NMF models must provide
a definition for their corresponding class (i.e.
sub-classes of class
NMF-class for more details.
signature(object = "NMF"): Pure virtual method for objects of class
NMF-class, that should be overloaded by sub-classes, and throws an error if called.
signature(object = "NMFstd"): Compute the target matrix estimate in standard NMF models.
The estimate matrix is computed as the product of the two
V ~ W H
signature(object = "NMFOffset"): Computes the target matrix estimate for an NMFOffset object.
The estimate is computed as:
W H + offset
signature(object = "NMFns"): Compute estimate for an NMFns object, according to the Nonsmooth NMF model (cf.
Extra arguments in
... are passed to method
smoothing, and are typically used to pass a value
theta, which is used to compute the smoothing
matrix instead of the one stored in
signature(object = "NMFfit"): Computes and return the estimated target matrix from an NMF model fitted with function
It is a shortcut for
dispatching the call to the
fitted method of the
actual NMF model.
# random standard NMF model x <- rnmf(3, 10, 5) all.equal(fitted(x), basis(x) %*% coef(x))
##  TRUE