| nmf.rrr | R Documentation |
nmfae fits a three-layer nonnegative matrix factorization model
Y_1 \approx X_1 \Theta X_2 Y_2, where X_1 is a decoder basis
(column sum 1), \Theta is a bottleneck parameter matrix,
X_2 is an encoder basis (row sum 1), and Y_2 is the input matrix.
When Y2 = Y1, the model acts as a non-negative autoencoder.
When Y1 != Y2, it acts as a heteroencoder.
Initialization uses a three-step NMF procedure via nmfkc:
(1) nmfkc(Y1, rank=Q) to obtain X_1,
(2) nmfkc(Y1, A=Y2, rank=Q) with fixed X_1 to obtain C = \Theta X_2,
(3) nmfkc(Y2, rank=R) to factor C into \Theta and X_2.
nmf.rrr(
Y1,
Y2 = Y1,
rank1 = 2,
rank2 = NULL,
epsilon = 1e-04,
maxit = 5000,
verbose = FALSE,
...
)
Y1 |
Output matrix |
Y2 |
Input matrix |
rank1 |
Integer. Rank of the response basis |
rank2 |
Integer. Rank of the covariate basis |
epsilon |
Positive convergence tolerance. Default is |
maxit |
Maximum number of multiplicative update iterations. Default is 5000. |
verbose |
Logical. If |
... |
Additional arguments:
Rank aliases accepted here for backward compatibility:
|
An object of class "nmfae", a list with components:
X1 |
Decoder basis matrix (P1 x Q), column sum 1. |
C |
Parameter matrix (Q x R). |
X2 |
Encoder basis matrix (R x P2), row sum 1. |
Y1hat |
Fitted values |
B1 |
Decoder-side scores |
H |
Deprecated; identical to |
B2 |
Encoder-side scores |
B1.prob, B2.prob |
Column-normalized |
B1.cluster, B2.cluster |
Hard label per sample (argmax over the columns
of the corresponding |
X1.prob |
Row-normalized |
X1.cluster |
Hard response-group label per response variable
(argmax over |
X2.prob |
Column-normalized |
X2.cluster |
Hard covariate-group label per covariate variable
(argmax over |
rank |
Named integer vector |
method |
Objective used ( |
objfunc |
Final objective value. |
objfunc.iter |
Objective values by iteration. |
r.squared |
|
r.squared.uncentered |
Uncentered |
r.squared.centered |
Row-mean centered |
niter |
Number of iterations performed. |
runtime |
Elapsed time as a |
n.missing |
Number of missing (or zero-weighted) elements in |
n.total |
Total number of elements in |
This function is experimental. The interface may change in future versions.
Satoh, K. (2025). Applying Non-negative Matrix Factorization with Covariates to Multivariate Time Series. Japanese Journal of Statistics and Data Science.
Satoh, K. and Tokuda, Y. (2026). Co-clustering of Response and Covariate Variables by Tri-Factorizing Their Non-negative Regression Coefficient Matrix. arXiv preprint arXiv:2607.27474. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.48550/arXiv.2607.27474")}
Lee, D. D. and Seung, H. S. (2001). Algorithms for Non-negative Matrix Factorization. Advances in Neural Information Processing Systems, 13.
Saha, S. et al. (2022). Hierarchical Deep Learning Neural Network (HiDeNN): An Artificial Intelligence (AI) Framework for Computational Science and Engineering. Computer Methods in Applied Mechanics and Engineering, 399.
nmf.rrr.inference, predict.nmfae, nmf.rrr.ecv, nmf.rrr.DOT, nmfkc
# Autoencoder example
Y <- matrix(c(1,0,1,0, 0,1,0,1, 1,1,0,0), nrow=3, byrow=TRUE)
res <- nmf.rrr(Y, rank1=2, rank2=2)
res$r.squared
# Heteroencoder example
Y1 <- matrix(c(1,0,0,1), nrow=2)
Y2 <- matrix(runif(8), nrow=4)
res2 <- nmf.rrr(Y1, Y2, rank1=2, rank2=2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.