% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/loo.R
\name{loo_compare.brma}
\alias{loo_compare.brma}
\alias{loo_compare}
\title{Compare brma Models Using LOO}
\usage{
\method{loo_compare}{brma}(x, ..., unit = "estimate")
}
\arguments{
\item{x}{a brma model object (the first model to compare).}

\item{...}{additional brma model objects or \code{loo} objects to compare.}

\item{unit}{output/deletion unit used when extracting LOO from brma objects.}
}
\value{
A matrix of class \code{"compare.loo"} as returned by
\code{\link[loo]{loo_compare}}.
}
\description{
Compare multiple brma models using LOO-PSIS cross-validation.
This is a convenience wrapper around \code{\link[loo]{loo_compare}}.
}
\details{
This function compares models based on their expected out-of-sample
predictive performance (ELPD).

\strong{Important for model comparison:} When comparing models via
\code{\link[loo]{loo_compare}}, the selection is based on expected
out-of-sample predictive performance. This evaluates how well models predict
\emph{new} observations, not how well they fit the observed data.
RoBMA rejects comparisons with different outcome targets/data, \code{unit},
or implied \code{conditioning_depth}.
}
\examples{
\dontrun{
if (requireNamespace("metadat", quietly = TRUE)) {
  data(dat.lehmann2018, package = "metadat")

  fit_bias <- RoBMA(yi = yi, vi = vi, data = dat.lehmann2018, measure = "SMD")
  fit_nobias <- BMA(yi = yi, vi = vi, data = dat.lehmann2018, measure = "SMD")

  fit_bias <- add_loo(fit_bias)
  fit_nobias <- add_loo(fit_nobias)

  loo_compare(fit_bias, fit_nobias)
  loo_compare(loo(fit_bias), loo(fit_nobias))
}
}

}
\seealso{
\code{\link{loo.brma}}, \code{\link[loo]{loo_compare}}
}
