% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/method-fitmeasures.R
\name{bfit_indices}
\alias{bfit_indices}
\alias{summary.bfit_indices}
\alias{print.bfit_indices}
\title{Bayesian Fit Indices}
\usage{
bfit_indices(
  object,
  baseline.model = NULL,
  rescale = c("devM", "MCMC"),
  nsamp = NULL,
  samp_copula = TRUE
)

\method{summary}{bfit_indices}(object, ...)

\method{print}{bfit_indices}(x, ...)
}
\arguments{
\item{object}{An object of class \link{INLAvaan}.}

\item{baseline.model}{An optional \link{INLAvaan} object representing the
baseline (null) model. Required for incremental fit indices (BCFI, BTLI,
BNFI).}

\item{rescale}{Character string controlling how the Bayesian chi-square
is rescaled. \code{"devM"} (default) subtracts pD from the deviance at each
sample. \code{"MCMC"} uses the classical chi-square and classical df at each
sample.}

\item{nsamp}{Number of posterior samples to draw. Defaults to the value
used when fitting the model.}

\item{samp_copula}{Logical. When \code{TRUE} (default), posterior samples are
drawn using the copula method with the fitted marginals. When \code{FALSE},
samples are drawn from the Gaussian (Laplace) approximation.}

\item{...}{Additional arguments passed to methods.}

\item{x}{An object of class \code{bfit_indices} (for \code{print}).}
}
\value{
An S3 object of class \code{"bfit_indices"} containing:
\describe{
\item{\code{indices}}{Named list of numeric vectors (one per posterior sample)
for each computed fit index.}
\item{\code{details}}{List with \code{chisq} (per-sample deviance), \code{df}, \code{pD},
\code{rescale}, and \code{nsamp}.}
}
Use \code{\link[=summary]{summary()}} to obtain a table of posterior summaries (Mean, SD,
quantiles, Mode) for each index.
}
\description{
Compute posterior distributions of Bayesian fit indices for an INLAvaan
model, analogous to \code{\link[blavaan:blavFitIndices]{blavaan::blavFitIndices()}}.
}
\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)

# Absolute fit indices
bf <- bfit_indices(fit)
bf
summary(bf)
}

}
\seealso{
\code{\link[lavaan:fitMeasures]{lavaan::fitMeasures()}}, \code{\link[blavaan:blavFitIndices]{blavaan::blavFitIndices()}},
\code{\link[=fitmeasures]{fitmeasures()}}, \code{\link[=compare]{compare()}}
}
