Skip to contents

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:

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

Examples

Y <- matrix(cars$dist, nrow = 1)
A <- rbind(intercept = 1, speed = cars$speed)
result <- nmfkc(Y, A, rank = 1)
#> Y(1,50)~X(1,1)C(1,2)A(2,50)=XB(1,50)...
#> 0sec
result2 <- nmfkc.inference(result, Y, A)
summary(result2)
#> 
#> Call:
#> nmfkc(Y = Y, A = A, rank = 1)
#> 
#> Dimensions: Y(1,50)~X(1,1)C(1,2)A(2,50)=XB(1,50) 
#> Rank (Q):    1 
#> Runtime:     0sec 
#> Method:      EU 
#> Iterations:  58 
#> Missing:     0 (0.0%) 
#> 
#> Statistics:
#>   Objective function:   12982 
#>   Multiple R-squared:   0.6511 
#>   Residual Std Error:   16.17 
#>   Mean Absolute Error:  12.71 
#>   ICp:                  5.559 
#> 
#> Structure Diagnostics:
#>   Basis (X) Sparsity:    0.0% (< 1e-4)
#>   Coef (B) Sparsity:     0.0% (< 1e-4)
#>   Clustering Entropy:    0 (range: 0-1, closer to 0 is better)
#>   Clustering Crispness:  1 (range: 0-1, closer to 1 is better)
#> 
#> Inference (conditional on X):
#>   sigma^2:   270.5 
#> 
#> Coefficients (conditional on X): 2 total, 1 significant
#>        Cov:Basis  Estimate Std. Error (Boot) z value   Pr(>z) 
#> intercept:Basis1     0.156      6.512  3.351    0.02   0.4904  
#>     speed:Basis1     2.900      0.464  0.439    6.25 2.102e-10 ***
#> ---
#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#>