% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/method-fitmeasures.R
\name{fitmeasures}
\alias{fitmeasures}
\alias{fitMeasures,INLAvaan-method}
\alias{fitmeasures,INLAvaan-method}
\title{Fit Measures for a Latent Variable Model estimated using INLA}
\arguments{
\item{object}{An object of class \link{INLAvaan}.}

\item{fit.measures}{If \code{"all"}, all fit measures available will be returned. If
only a single or a few fit measures are specified by name, only those are
computed and returned. The LOO measures \code{"elpd_loo"}, \code{"se_loo"},
\code{"p_loo"} and \code{"looic"} (see \code{\link[=loo]{loo()}}) are included in \code{"all"} only when
a LOO result is stored with the fit (\code{test = "loo"} in \code{\link[=inlavaan]{inlavaan()}} or
\code{\link[=add_loo]{add_loo()}}); otherwise they are computed on demand when requested by
name, and recomputed on every call -- store the result with
\code{fit <- add_loo(fit)} (or call \code{\link[=loo]{loo()}} directly) for repeated access.}

\item{baseline.model}{An optional \link{INLAvaan} object representing the
baseline (null) model. Required for incremental fit indices (BCFI, BTLI,
BNFI). Must have been fitted with \code{test != "none"}.}

\item{h1.model}{Ignored (included for compatibility with the lavaan
generic).}

\item{fm.args}{Ignored (included for compatibility with the lavaan
generic).}

\item{output}{Ignored (included for compatibility with the lavaan
generic).}

\item{...}{Additional arguments. Currently supports:
\describe{
\item{\code{rescale}}{Character string controlling how the Bayesian chi-square
is computed, following \code{blavaan::blavFitIndices()}. Options are \code{"devM"}
(default) which uses the deviance rescaled by \code{pD} from DIC, or \code{"MCMC"}
which uses the classical chi-square (\code{(N-1) * F_ML}) and classical
degrees of freedom (\code{p - npar}) at each posterior sample.}
}}
}
\value{
A named numeric vector of fit measures.
}
\description{
Fit Measures for a Latent Variable Model estimated using INLA
}
\examples{
\donttest{
HS.model <- "
  visual  =~ x1 + x2 + x3
  textual =~ x4 + x5 + x6
  speed   =~ x7 + x8 + x9
"
utils::data("HolzingerSwineford1939", package = "lavaan")
fit <- acfa(HS.model, HolzingerSwineford1939, std.lv = TRUE, nsamp = 100,
            verbose = FALSE)

# All available fit measures
fitMeasures(fit)

# Specific measures
fitMeasures(fit, c("npar", "DIC", "pD", "ppp"))
}

}
\seealso{
\code{\link[=bfit_indices]{bfit_indices()}}, \code{\link[=compare]{compare()}}, \code{\link[=diagnostics]{diagnostics()}}
}
