nmfkc.inference: Statistical inference for the parameter matrix C (Theta)

View source: R/nmfkc.R

nmfkc.inferenceR Documentation

Statistical inference for the parameter matrix C (Theta)

Description

nmfkc.inference performs statistical inference on the parameter matrix C (\Theta) from a fitted nmfkc model, conditional on the estimated basis matrix \hat{X}.

Under the working model Y = X C A + \varepsilon where \varepsilon_{pn} \stackrel{iid}{\sim} N(0, \sigma^2), inference is conducted via sandwich covariance estimation and one-step wild bootstrap with non-negative projection.

Usage

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

Arguments

object

An object of class "nmfkc" returned by nmfkc.

Y

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

A

Covariate matrix (K x N). Default is NULL (same as identity; in this case B = C and inference is on B directly).

wild.bootstrap

Logical. If TRUE (default), performs wild bootstrap for confidence intervals and bootstrap standard errors. Set to FALSE to skip bootstrap (faster, only sandwich SE is computed).

...

Additional arguments:

method

Bootstrap engine. "onestep" (default): a one-step Newton linearisation around the fit using the inverse information Hinv (fast; the sandwich SE is primary). "refit": a residual wild bootstrap that re-estimates C to convergence with the basis X held FIXED. The "refit" engine uses no information matrix, so it stays valid when the Fisher information AA' is singular (over-parameterised covariates) or C sits on the \ge 0 boundary; the bootstrap SE/CI become primary and the p-value is a two-sided bootstrap p-value.

wild.dist

Multiplier distribution (orthogonal to method): "rademacher" (\pm 1), "mammen" (Mammen 1993 two-point), or "exp" (\mathrm{Exp}(1)-1). Default "exp" for method="onestep" (backward compatible), "rademacher" for "refit".

wild.unit

For method="refit": "element" (default, i.i.d. multiplier per matrix cell) or "column" (one multiplier per sample column, shared over rows).

wild.B

Number of bootstrap replicates. Default is 1000.

wild.seed

Seed for bootstrap. Default is 42.

wild.level

Confidence level for bootstrap CI. Default is 0.95.

sandwich

Logical. Use sandwich covariance. Default is TRUE.

C.p.side

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

cov.ridge

Ridge stabilization for information matrix inversion. Default is 1e-8.

print.trace

Logical. If TRUE, prints progress. Default is FALSE.

Value

An object of class c("nmfkc.inference", "nmfkc"), inheriting all components from the input object, with additional inference components:

sigma2.used

Estimated \sigma^2 used for inference.

C.se

Sandwich standard errors for C (Q x K matrix).

C.se.boot

Bootstrap standard errors for C (Q x K matrix).

C.ci.lower

Lower CI bounds for C (Q x K matrix).

C.ci.upper

Upper CI bounds for C (Q x K matrix).

coefficients

Data frame with Estimate, SE, BSE, z, p-value for each element of C.

C.p.side

P-value type used.

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

nmfkc, summary.nmfkc.inference

Examples

Y <- matrix(cars$dist, nrow = 1)
A <- rbind(intercept = 1, speed = cars$speed)
result <- nmfkc(Y, A, rank = 1)
result2 <- nmfkc.inference(result, Y, A)
summary(result2)


nmfkc documentation built on July 14, 2026, 1:07 a.m.