| nmf.ffb | R Documentation |
Fits the NMF-FFB model
Y_1 = X B + E, \qquad B = \Theta_1 Y_1 + \Theta_2 Y_2 + U,
in which a non-negative basis X (P_1 \times Q) generates the
endogenous block Y_1 from latent scores B that are driven by
the exogenous block Y_2 (feed-forward, \Theta_2) and fed back
by Y_1 itself (latent feedback, \Theta_1). The function
returns the estimated basis, the structural coefficient matrices and the
implied equilibrium (input-output) mapping.
At equilibrium, the model can be written as
Y_1 \approx (I - X \Theta_1)^{-1} X \Theta_2 Y_2
\equiv M_{\mathrm{model}} Y_2,
where M_{\mathrm{model}} = (I - X \Theta_1)^{-1} X \Theta_2 is a
Leontief-type cumulative-effect operator in latent space.
Internally, the latent feedback and exogenous loading matrices are stored as
C1 and C2, corresponding to \Theta_1 and \Theta_2,
respectively.
Two estimators are available through method:
"fiml" (default)A two-stage likelihood-based estimator.
Stage 1 estimates the basis with the feed-forward fit
nmfkc(Y1, A = Y2) (X.init, X.L2.ortho,
epsilon, maxit, seed are forwarded), unless a
basis is supplied through X. Columns are normalized to unit
sum. Stage 2 holds \hat X fixed and fits the Gaussian
working model U \sim N(0, \Phi), E \sim N(0,
\mathrm{diag}(\psi)) by full-information maximum likelihood
(L-BFGS-B with an analytic gradient) under the non-negativity of
\Theta_1, \Theta_2 and an exclusion restriction on
\Theta_1. It fits (a) the feed-forward null \Theta_1 = 0
(a non-negative MIMIC factor model with correlated factors), (b) the
unpenalized feedback model on the admitted entries, and (c) an L1
path over C1.L1.path. The penalized problem is non-convex, so
every point of the path is fitted from several starting points
(starts); every distinct support proposed by any (penalty,
start) pair is re-estimated without penalty (itself from three
starts, keeping the best log-likelihood) and BIC is minimized over
all distinct candidates together with the null and the unpenalized
model. The support with the smallest BIC is the selected
model, reported in C1, C2, Phi, psi.
C1.L1 and C2.L1 are not used by this estimator. The likelihood-ratio statistics against the null are
returned without p-values: \Theta_1 \ge 0 puts the null on the
boundary of the parameter space and the BIC refit is a post-selection
statistic, so a chi-square reference is not valid. Their calibration
by parametric bootstrap is done by nmf.ffb.inference.
"mu"The legacy estimator: joint multiplicative updates of
X, \Theta_1, \Theta_2 for the structural-form squared error
\lVert Y_1 - X(\Theta_1 Y_1 + \Theta_2 Y_2)\rVert_F^2 with an
orthogonality penalty on X and L1 penalties C1.L1,
C2.L1. Kept, bit-identical, so that analyses published with it
reproduce. Because the structural and reduced forms have the same
fit once X is free, this estimator cannot separate
\Theta_1 from \Theta_2; prefer "fiml".
nmf.ffb(
Y1,
Y2,
rank = NULL,
X.init = "nndsvd",
X.L2.ortho = 100,
C1.L1 = 1,
C2.L1 = 0.1,
epsilon = 1e-06,
maxit = 5000,
seed = 123,
...,
method = c("fiml", "mu"),
X = NULL,
C1.restriction = c("union", "none"),
C1.restriction.threshold = 0.05,
Phi.restriction = c("full", "diag"),
C1.L1.path = NULL,
select = c("BIC", "none")
)
Y1 |
A non-negative numeric matrix of endogenous variables with rows = variables (P1), columns = samples (N). |
Y2 |
A non-negative numeric matrix of exogenous variables with
rows = variables (P2), columns = samples (N).
Must satisfy |
rank |
Integer; number of latent factors |
X.init |
Initialization strategy for the basis matrix
To impose anchor rows on the stage-1 basis instead, pass
|
X.L2.ortho |
L2 orthogonality penalty for |
C1.L1 |
L1 sparsity penalty for |
C2.L1 |
L1 sparsity penalty for |
epsilon |
Relative convergence threshold for the objective function.
Iterations stop when the relative change in reconstruction loss
falls below this value. Default: |
maxit |
Maximum number of iterations for the multiplicative updates.
Default: |
seed |
Random seed used to initialize |
... |
Additional hidden arguments. For
|
method |
|
X |
Optional basis for |
C1.restriction |
Exclusion restriction on |
C1.restriction.threshold |
Loading threshold for
|
Phi.restriction |
Covariance of the latent disturbance |
C1.L1.path |
Numeric vector of L1 penalties on |
select |
|
An object of class c("nmf.ffb", "nmf"), a list
with components:
X |
Estimated basis matrix ( |
C1 |
Estimated latent feedback matrix ( |
C2 |
Estimated exogenous loading matrix ( |
XC1 |
Feedback matrix |
XC2 |
Direct-effect matrix |
XC1.radius |
Spectral radius |
XC1.norm1 |
Induced 1-norm |
Leontief.inv |
Leontief-type inverse |
M.model |
Equilibrium mapping
|
amplification |
Latent amplification factor
|
amplification.bound |
Geometric-series upper bound
|
rank |
Effective latent dimension used in the fit. |
SC.cov |
Correlation between sample and model-implied covariance
(flattened) of |
SC.map |
Correlation between the equilibrium operator
|
mae |
Mean absolute error between |
objfunc |
Vector of reconstruction losses per iteration
( |
objfunc.penalized |
Vector of penalized objective values per iteration
( |
iter, maxit, epsilon, converged |
Convergence bookkeeping. For
|
method |
|
The following are present for method = "fiml" only
(SC.cov and SC.map are then NULL):
Phi, psi, loglik, npar |
Latent-disturbance covariance
( |
null |
The feed-forward null: list |
full |
The unpenalized feedback fit: list |
path |
Data frame with one row per ( |
candidates, supports, support.selected |
One row per distinct
support ( |
C1.free, C1.L1.path, C1.L1.selected, support |
The free-entry matrix used
( |
LR, LR.df |
Likelihood-ratio statistics |
BIC, AIC |
Named vectors |
call |
The matched call, from which
|
Feedback is identified only through exclusion restrictions: an outcome
may not feed back into a factor on which it has more than a negligible
loading, because such an entry is nearly equivalent to a change of the
outcome's loading and uniqueness. With
C1.restriction = "union" (default) entry (q, i) of \Theta_1 is
excluded if q = \arg\max_{q'} X_{i q'} (the dominant factor) or
X_{iq} \ge C1.restriction.threshold. Both halves are needed:
blocking the dominant factor alone would leave an outcome with a
substantial second loading free to feed that factor, and blocking only the
factors above the threshold would leave an outcome whose largest loading is
below the threshold free to feed its own.
"none" frees every entry (not recommended: the model is then
identified only through the non-negativity and the covariance structure).
A user-supplied Q \times P_1 0/1 matrix is used as given.
The restriction is derived from the estimated basis and therefore from the same
Y_1 that is subsequently tested; see the Calibration section
of nmf.ffb.inference for what this implies.
method = "fiml" became the default in version 0.9.8, as did
C1.restriction = "union" (earlier fiml fits blocked the dominant
factor only), and
nmf.ffb.inference gained the calibration argument.
method = "mu" is the legacy estimator, kept for the reproducibility
of published analyses; it will be deprecated in a later release.
Satoh, K. (2025). Applying non-negative matrix factorization with covariates to structural equation modeling for blind input-output analysis. arXiv:2512.18250. https://arxiv.org/abs/2512.18250
nmf.ffb.inference, nmf.ffb.cv,
nmf.ffb.split, nmf.ffb.DOT,
summary.nmf.ffb
# Simple NMF-FFB with iris data (non-negative)
Y <- t(iris[, -5])
Y1 <- Y[1:2, ] # Sepal
Y2 <- Y[3:4, ] # Petal
result <- nmf.ffb(Y1, Y2, rank = 2)
result$LR # feedback vs feed-forward null (no p-value here)
result$BIC
result$path
# Legacy multiplicative-update estimator
result.mu <- nmf.ffb(Y1, Y2, rank = 2, maxit = 500, method = "mu")
result.mu$mae
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.