Learn R Programming

nnmf (version 1.1)

nmfqp.reg: NMF with covariates minimizing the Frobenius norm

Description

NMF with covariates minimizing the Frobenius norm using quadratic programming.

Usage

nmfqp.reg(x, z, k, maxiter = 1000, tol = 1e-6, ncores = 1)

Value

B

The \(B\) matrix, an \(q \times D\) matrix with the coefficients of the covariates.

W

The \(W\) matrix, an \(n \times k\) matrix with the mapped data.

H

The \(H\) matrix, an \(k \times D\) matrix.

fitted

The reconstructed data, \(fitted = ZB + WH\).

obj

The reconstruction error, \( ||x - fitted||_F^2\).

iters

The number of iterations performed.

runtime

The runtime required by the algorithm.

Arguments

x

An \(n \times D\) numerical matrix with data.

z

An \(n \times q\) matrix with the covariates.

k

The number of lower dimensions. It must be less than the dimensionality of the data, at most \(D-1\).

maxiter

The maximum number of iterations allowed.

tol

The tolerance value to terminate the quadratic programming algorithm.

ncores

Do you want the update of W to be performed in parallel? If yes, specify the number of cores to use.

Author

Michail Tsagris.

R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.

Details

Nonnegative matrix factorization with covariates using quadratic programming is performed. The objective function to be minimized is the square of the Frobenius norm of the residuals produced by the reconstructed matrix.

References

Alenazi A. and Tsagris M. (2026). Simplicial nonnegative matrix factorization. In preparation.

Cutler A. and Breiman L. (1994). Archetypal analysis. Technometrics, 36(4): 338--347.

See Also

nmf.sqp

Examples

Run this code
x <- as.matrix(iris[, 1:3])
z <- model.matrix(x ~., data = iris[, 4:5])[, -1]
mod <- nmfqp.reg(x, z, 2)

Run the code above in your browser using DataLab