% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/nmfkc.R
\name{nmfkc.inference}
\alias{nmfkc.inference}
\title{Statistical inference for the parameter matrix C (Theta)}
\usage{
nmfkc.inference(object, Y, A = NULL, wild.bootstrap = TRUE, ...)
}
\arguments{
\item{object}{An object of class \code{"nmfkc"} returned by \code{\link{nmfkc}}.}

\item{Y}{Observation matrix (P x N). Must match the data used in \code{nmfkc()}.}

\item{A}{Covariate matrix (K x N). Default is \code{NULL} (same as identity;
in this case \eqn{B = C} and inference is on \eqn{B} directly).}

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

\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("nmfkc.inference", "nmfkc")}, 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{C} (Q x K matrix).}
\item{C.se.boot}{Bootstrap standard errors for \eqn{C} (Q x K matrix).}
\item{C.ci.lower}{Lower CI bounds for \eqn{C} (Q x K matrix).}
\item{C.ci.upper}{Upper CI bounds for \eqn{C} (Q x K matrix).}
\item{coefficients}{Data frame with Estimate, SE, BSE, z, p-value for each element of \eqn{C}.}
\item{C.p.side}{P-value type used.}
}
\description{
\code{nmfkc.inference} performs statistical inference on the parameter matrix
\eqn{C} (\eqn{\Theta}) from a fitted \code{nmfkc} model, conditional on
the estimated basis matrix \eqn{\hat{X}}.

Under the working model \eqn{Y = X C A + \varepsilon} where
\eqn{\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.
}
\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)

}
\references{
Satoh, K. (2026). Wild Bootstrap Inference for Non-Negative Matrix
Factorization with Random Effects. arXiv:2603.01468.
\url{https://arxiv.org/abs/2603.01468}
}
\seealso{
\code{\link{nmfkc}}, \code{\link{summary.nmfkc.inference}}
}
