% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/decision.R
\name{htdv_waic_lfo}
\alias{htdv_waic_lfo}
\title{WAIC and Leave-Future-Out Cross-Validation}
\usage{
htdv_waic_lfo(fit, L = NULL, k_threshold = 0.7)
}
\arguments{
\item{fit}{An \code{htdv_fit} object with pointwise log-likelihood stored
as parameter \code{log_lik}.}

\item{L}{Block-prefix length; leave-future-out starts at time \code{L+1}.
Default \code{floor(n/5)}.}

\item{k_threshold}{Pareto-k refresh threshold; when exceeded, importance
sampling is refreshed.}
}
\value{
A list with \code{waic}, \code{elpd_lfo}, \code{elpd_se},
  \code{pareto_k}, and \code{refresh_times}.
}
\description{
Computes the Widely Applicable Information Criterion (Watanabe 2010) and
leave-future-out expected log predictive density (Buerkner-Gabry-Vehtari
2020) from a fitted \code{\link{htdv_fit}} object.
}
\examples{
\donttest{
if (requireNamespace("loo", quietly = TRUE)) {
  x <- rnorm(50)
  fit <- htdv_fit(x, model = "tac", chains = 2, iter = 500,
                  refresh = 0, seed = 1)
  htdv_waic_lfo(fit)$waic
}
}

}
\references{
Watanabe, S. (2010). Asymptotic Equivalence of Bayes Cross Validation and
Widely Applicable Information Criterion. JMLR 11: 3571-3594.
Buerkner, P.-C., Gabry, J., & Vehtari, A. (2020). Approximate
Leave-Future-Out Cross-Validation for Bayesian Time Series Models. Journal
of Statistical Computation and Simulation 90(14): 2499-2523.
}
