% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/s3methods.R
\name{coef.nmf}
\alias{coef.nmf}
\alias{coef.nmf.sem}
\title{Extract coefficients from NMF models}
\usage{
\method{coef}{nmf}(object, ...)

\method{coef}{nmf.sem}(object, ...)
}
\arguments{
\item{object}{A fitted model object of class \code{"nmf"}, \code{"nmfkc"},
\code{"nmfae"}, \code{"nmfre"}, or \code{"nmf.sem"}.}

\item{...}{Not used.}
}
\value{
A data frame of coefficients (if inference was performed),
or the parameter matrix \eqn{C}.
}
\description{
Returns the \code{coefficients} data frame from a fitted NMF model
that has been passed through an inference function
(\code{\link{nmfkc.inference}}, \code{\link{nmfae.inference}},
\code{\link{nmfre.inference}}).

If inference has not been run, returns the parameter matrix \eqn{C}
(\eqn{\Theta}) directly.

For \code{nmf.sem} objects, returns \eqn{C_2} (exogenous block) as fallback.
}
\examples{
Y <- matrix(cars$dist, nrow = 1)
A <- rbind(1, cars$speed)
result <- nmfkc(Y, A, rank = 1)
coef(result)  # returns C matrix

result2 <- nmfkc.inference(result, Y, A)
coef(result2)  # returns coefficients data frame

}
\seealso{
\code{\link{nmfkc.inference}}, \code{\link{nmfae.inference}},
\code{\link{nmfre.inference}}, \code{\link{nmf.sem.inference}}
}
