% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/nmfae.R
\name{nmfae.inference}
\alias{nmfae.inference}
\title{Statistical Inference for NMF-AE Parameter Matrix}
\usage{
nmfae.inference(object, Y1, Y2 = Y1, wild.bootstrap = TRUE, ...)
}
\arguments{
\item{object}{An object of class \code{"nmfae"} returned by \code{\link{nmfae}}.}

\item{Y1}{Output matrix \eqn{Y_1} (P1 x N). Must match the data used in \code{nmfae()}.}

\item{Y2}{Input matrix \eqn{Y_2} (P2 x N). Default is \code{Y1} (autoencoder).}

\item{wild.bootstrap}{Logical. If \code{TRUE} (default), performs wild bootstrap
for bootstrap SE and confidence intervals. If \code{FALSE}, only sandwich SE
and z-test p-values are computed (faster).}

\item{...}{Additional arguments:
\describe{
\item{\code{wild.B}}{Number of bootstrap replicates. Default is 1000.}
\item{\code{wild.seed}}{Seed for bootstrap. Default is 42.}
\item{\code{wild.level}}{Confidence level for bootstrap CI. Default is 0.95.}
\item{\code{sandwich}}{Logical. Use sandwich covariance. Default is \code{TRUE}.}
\item{\code{C.p.side}}{P-value type: \code{"one.sided"} (default) or \code{"two.sided"}.}
\item{\code{cov.ridge}}{Ridge stabilization for information matrix inversion. Default is 1e-8.}
\item{\code{print.trace}}{Logical. If \code{TRUE}, prints progress. Default is \code{FALSE}.}
}}
}
\value{
An object of class \code{c("nmfae.inference", "nmfae")}, inheriting all
components from the input \code{object}, with additional inference components:
\item{sigma2.used}{Estimated \eqn{\sigma^2} used for inference.}
\item{C.se}{Sandwich standard errors for \eqn{\Theta} (Q x R matrix).}
\item{C.se.boot}{Bootstrap standard errors for \eqn{\Theta} (Q x R matrix).}
\item{C.ci.lower}{Lower CI bounds for \eqn{\Theta} (Q x R matrix).}
\item{C.ci.upper}{Upper CI bounds for \eqn{\Theta} (Q x R matrix).}
\item{coefficients}{Data frame with Estimate, SE, BSE, z, p-value for each element of \eqn{\Theta}.}
\item{C.p.side}{P-value type used.}
}
\description{
Performs post-estimation inference for \eqn{\Theta} in the three-layer NMF model
\eqn{Y_1 \approx X_1 \Theta X_2 Y_2}, conditional on \eqn{(\hat{X}_1, \hat{X}_2)}.
Uses sandwich covariance estimation and one-step wild bootstrap with
non-negative projection.
}
\section{Lifecycle}{

This function is \strong{experimental}. The interface may change in
future versions; details are to be described in an upcoming paper.
}

\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)

}
\seealso{
\code{\link{nmfae}}, \code{\link{summary.nmfae.inference}}
}
