% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/S3loo.R
\name{get.log_lik}
\alias{get.log_lik}
\alias{get.log_lik.default}
\title{Extract pointwise log-likelihood matrix}
\usage{
get.log_lik(object, ...)

\method{get.log_lik}{default}(object, ...)
}
\arguments{
\item{object}{A fitted ForceChoice model object.}

\item{...}{Additional arguments (currently ignored).}
}
\value{
An \eqn{S \times N} matrix of pointwise log-likelihood draws
(Stan), or \code{NULL} (EM / iStEM).
}
\description{
For Stan-fitted models, returns the posterior draws of pointwise
log-likelihood (an \eqn{S \times N_{\text{obs}}} matrix for most models,
or \eqn{S \times N} for FCDCM and FCGDINA).  For EM and iStEM fits,
returns \code{NULL}.
}
\details{
The returned matrix can be passed directly to \code{\link[loo]{loo}} or
\code{\link[loo]{waic}} for model comparison.
}
\section{Methods (by class)}{
\itemize{
\item \code{get.log_lik(default)}: Default method; returns \code{object$log_lik}
when present and \code{NULL} otherwise.

}}
\examples{
\donttest{
# stan code, long time
sim <- sim.data.MIRT(N = 20, I = 6, D = 2, model = "2PL")
fit <- fit.MIRT(sim$response, model = "2PL", D = 2, method = "stan")
log_lik <- get.log_lik(fit)
loo::loo(log_lik)
loo::waic(log_lik)
}
}
