Performs post-estimation inference for \(\Theta\) in the three-layer NMF model \(Y_1 \approx X_1 \Theta X_2 Y_2\), conditional on \((\hat{X}_1, \hat{X}_2)\). Uses sandwich covariance estimation and one-step wild bootstrap with non-negative projection.
Arguments
- object
An object of class
"nmfae"returned bynmfae.- Y1
Output matrix \(Y_1\) (P1 x N). Must match the data used in
nmfae().- Y2
Input matrix \(Y_2\) (P2 x N). Default is
Y1(autoencoder).- wild.bootstrap
Logical. If
TRUE(default), performs wild bootstrap for bootstrap SE and confidence intervals. IfFALSE, only sandwich SE and z-test p-values are computed (faster).- ...
Additional arguments:
wild.BNumber of bootstrap replicates. Default is 1000.
wild.seedSeed for bootstrap. Default is 42.
wild.levelConfidence level for bootstrap CI. Default is 0.95.
sandwichLogical. Use sandwich covariance. Default is
TRUE.C.p.sideP-value type:
"one.sided"(default) or"two.sided".cov.ridgeRidge stabilization for information matrix inversion. Default is 1e-8.
print.traceLogical. If
TRUE, prints progress. Default isFALSE.
Value
An object of class c("nmfae.inference", "nmfae"), 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 \(\Theta\) (Q x R matrix).
- C.se.boot
Bootstrap standard errors for \(\Theta\) (Q x R matrix).
- C.ci.lower
Lower CI bounds for \(\Theta\) (Q x R matrix).
- C.ci.upper
Upper CI bounds for \(\Theta\) (Q x R matrix).
- coefficients
Data frame with Estimate, SE, BSE, z, p-value for each element of \(\Theta\).
- C.p.side
P-value type used.
Examples
Y <- matrix(c(1,0,1,0, 0,1,0,1, 1,1,0,0), nrow=3, byrow=TRUE)
res <- nmfae(Y, rank=2, rank.encoder=2)
res2 <- nmfae.inference(res, Y)
summary(res2)
#>
#> Call:
#> nmfae(Y1 = Y, rank = 2, rank.encoder = 2)
#>
#> Dimensions:
#> Y1: 3 x 4
#> Y2: 3 x 4 (autoencoder)
#> Decoder rank Q: 2
#> Encoder rank R: 2
#> Parameters: X1(3x2) + C(2x2) + X2(2x3) = 16
#>
#> Convergence:
#> Iterations: 23
#> Runtime: 0.0 secs
#>
#> Goodness of fit:
#> Objective function: 0.7558
#> Multiple R-squared: 0.7481
#> Residual Std Error: 0.251
#> Mean Absolute Error: 0.2031
#>
#> Structure Diagnostics:
#> X1 sparsity (< 1e-4): 33.3%
#> C sparsity (< 1e-4): 0.0%
#> X2 sparsity (< 1e-4): 33.3%
#>
#> Coefficients (conditional on X1, X2): 4 total, 2 significant
#> Enc:Dec Estimate Std. Error (Boot) z value Pr(>z)
#> Enc1:Dec1 1.657 0.102 0.083 16.28 <2e-16 ***
#> Enc1:Dec2 0.000 0.189 0.067 0.00 0.4993
#> Enc2:Dec1 0.000 0.189 0.066 0.00 0.4993
#> Enc2:Dec2 1.657 0.102 0.090 16.28 <2e-16 ***
#> ---
#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#>