nmfre.inference: Statistical inference for the coefficient matrix C from...

View source: R/nmfre.R

nmfre.inferenceR Documentation

Statistical inference for the coefficient matrix C from NMF-RE

Description

nmfre.inference performs statistical inference on the coefficient matrix C (\Theta) from a fitted nmfre model, conditional on the estimated basis matrix \hat{X} and random effects \hat{U}.

Under the working model Y^* = Y - X\hat{U} \approx X C A + \varepsilon, inference is conducted via sandwich covariance estimation and one-step wild bootstrap with non-negative projection.

The result is compatible with nmfkc.DOT for visualization (pass the result directly as x with type = "YXA").

Usage

nmfre.inference(object, Y, A = NULL, wild.bootstrap = TRUE, ...)

Arguments

object

An object of class "nmfre" returned by nmfre.

Y

Observation matrix (P x N). Must match the data used in nmfre().

A

Covariate matrix (K x N). Default is NULL (intercept only).

wild.bootstrap

Logical. If TRUE (default), performs wild bootstrap for confidence intervals and bootstrap standard errors.

...

Additional arguments:

wild.B

Number of bootstrap replicates. Default is 500.

wild.seed

Seed for bootstrap. Default is 123.

wild.level

Confidence level for bootstrap CI. Default is 0.95.

C.p.side

P-value type: "one.sided" (default) or "two.sided".

cov.ridge

Ridge stabilization. Default is 1e-8.

print.trace

Logical. Default is FALSE.

profile

Logical. If TRUE, also computes profile-likelihood intervals for the entries of C (sign-free C only). Default FALSE: each entry needs a sequence of constrained refits.

profile.which

Entries of vec(C) to profile. Default all.

profile.level

Level of the profile intervals. Default 0.95.

profile.step, profile.maxstep

Step, in standard errors, and number of steps of the outward search. Defaults 0.25 and 24.

Details

Inference is on the representation returned by nmfre (by default the geomin member of its identification region; with orient = "none" the point where its algorithm stopped; see there). Its C.ident.* and X.ident.* ranges are kept.

Profile intervals. With profile = TRUE, for each entry the profile marginal likelihood is followed outward from the end of its identification region until twice the drop exceeds the \chi^2_1 quantile; the interval is the level set. The profile is computed by continuation: the entry moves outward in steps of profile.step standard errors, and each constrained maximization (BFGS) starts from the previous solution. The search is local, which is meant to keep it away from other components of the region and from relabellings (they attain the same maximum), but it neither certifies a global maximum nor excludes other branches. C.profile.reached records whether the level was crossed on both sides within profile.maxstep steps.

Value

The input object with additional inference components:

sigma2.used

Estimated \sigma^2 used for inference.

C.vec.cov

Full covariance matrix for vec(C).

C.se

Sandwich standard errors for C.

C.se.boot

Bootstrap standard errors for C.

C.ci.lower

Lower CI bounds for C.

C.ci.upper

Upper CI bounds for C.

coefficients

Data frame with Basis, Covariate, Estimate, SE, BSE, z_value, p_value, CI_low, CI_high.

C.p.side

P-value type used.

identified.approx

Whether (X, C) is unique up to a permutation of the bases, by the data. With C.signed = FALSE it is the diagnostic of nmfkc.inference on (X, C). With a signed C (the default) non-negativity cannot pin the rotation, so it is NA: only the working model's isotropic random effects U\sim N(0,\tau^2 I) do, by allowing orthogonal T alone, which with the column sums of X fixed is a permutation when Q=2 or every basis has an anchor row. That is identification by assumption. An algebraic check on the point estimate: no re-fits.

identification

The parts of the diagnostic, plus by.assumption (the isotropic argument above holds, with \tau^2>0: Q\le2, an anchor row on every basis, or, for Q=3, an identification region computed by nmfre that is a point) and note: for a signed C, and for C\ge0 when non-negativity alone does not pin the factorization but the isotropic random effects do. The identification-region entries that nmfre put in this list (width, arc, full.circle, orient) are kept.

C.profile.lower, C.profile.upper, C.profile.reached

With profile = TRUE: profile-likelihood interval of each entry of C (Q x K matrices, NA for entries not profiled) and whether the level was crossed on both sides.

References

Satoh, K. (2026). Wild Bootstrap Inference for Non-Negative Matrix Factorization with Random Effects. arXiv:2603.01468. https://arxiv.org/abs/2603.01468

See Also

nmfre, nmfkc.DOT, summary.nmfre

Examples

Y <- matrix(cars$dist, nrow = 1)
A <- rbind(intercept = 1, speed = cars$speed)
res <- nmfre(Y, A, rank = 1, wild.bootstrap = FALSE)
res2 <- nmfre.inference(res, Y, A)
res2$coefficients


nmfkc documentation built on Nov. 30, 2026, 1:06 a.m.