% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/loo.R
\name{dcvar_compare}
\alias{dcvar_compare}
\title{Compare multiple fitted models using LOO-CV}
\usage{
dcvar_compare(...)
}
\arguments{
\item{...}{Named fitted model objects (e.g., \verb{dcvar = fit1, hmm = fit2}).}
}
\value{
A \code{loo_compare} matrix.
}
\description{
Convenience wrapper around \code{\link[loo:loo_compare]{loo::loo_compare()}} that accepts named
dcvar model fits.
}
\details{
The pointwise \code{log_lik} estimands are not identical across model
families: HMM fits marginalize the discrete states out of each one-step
predictive density, while dynamic (DC-VAR and covariate) fits condition
on the smoothed latent \code{rho} trajectory, which is informed by the
observation itself. Comparing an HMM fit against a dynamic fit can
therefore systematically favor the dynamic model; a warning is emitted
for such comparisons and the resulting elpd differences should be
interpreted with caution.
}
\examples{
\donttest{
sim <- simulate_dcvar(
  n_time = 12,
  rho_trajectory = rho_decreasing(12),
  seed = 1
)
fit_dcvar <- dcvar(
  sim$Y_df,
  vars = c("y1", "y2"),
  chains = 1,
  iter_warmup = 10,
  iter_sampling = 10,
  refresh = 0,
  seed = 1
)
fit_constant <- dcvar_constant(
  sim$Y_df,
  vars = c("y1", "y2"),
  chains = 1,
  iter_warmup = 10,
  iter_sampling = 10,
  refresh = 0,
  seed = 1
)
dcvar_compare(dcvar = fit_dcvar, constant = fit_constant)
}
}
\seealso{
\code{\link[loo:loo_compare]{loo::loo_compare()}} for details on the comparison method,
\code{\link[=dcvar]{dcvar()}}, \code{\link[=dcvar_hmm]{dcvar_hmm()}}, \code{\link[=dcvar_constant]{dcvar_constant()}} for fitting models.
}
