% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/bayesRecon_t.R
\name{bayesRecon_t}
\alias{bayesRecon_t}
\title{t-Rec: reconciliation via conditioning with uncertain covariance via multivariate t-distribution}
\usage{
bayesRecon_t(models, ...)
}
\arguments{
\item{models}{A list of fitted models to reconcile.}

\item{...}{Additional arguments passed to other methods, including:
\itemize{
\item \code{prior}: Optional list with entries \code{nu} and \code{Psi} specifying the parameters
of the Inverse-Wishart prior distribution for the covariance matrix.
If not provided, the prior is estimated from the data.
\item \code{freq}: Optional frequency of the time series, used for estimating the naive covariance matrix
via seasonal naive residuals. If not provided, the frequency is inferred from the data.
\item \code{criterion}: Criterion for estimating the naive covariance matrix (default: "RSS").
\item \code{l_shr}: Optional shrinkage parameter (between 0 and 1) for the covariance matrix of the residuals.
}}
}
\value{
A model specification of class \code{"bayesRecon_t"}
(inheriting from \code{"mdl_lst"}) to be passed to
\code{\link[fabletools]{reconcile}}. The reconciliation is
performed when \code{\link[fabletools]{forecast}} is called on
the resulting mable (a model table). The forecast output is a \code{fable} object
containing reconciled probabilistic forecasts represented as
sample distributions (\code{\link[distributional]{dist_student_t}}).
}
\description{
Specifies t-Rec reconciliation for use within \code{reconcile()}.

Reconciles base forecasts by conditioning on the hierarchical constraints.
The base forecasts are assumed to be jointly Gaussian,
conditionally on the covariance matrix of the forecast errors.
A Bayesian approach is adopted to account for the uncertainty of the covariance matrix.
An Inverse-Wishart prior is specified on the covariance matrix,
leading to a multivariate t-distribution for the base forecasts.
The reconciliation via conditioning is in closed-form,
yielding a multivariate t reconciled distribution.

Reconciliation is performed when \code{forecast()} is called on the resulting model.
Marginal reconciled forecasts follow a Student-t distribution.
}
\examples{
library(fable)
library(fabletools)
library(tsibble)
library(fable.bayesRecon)

# Small hierarchical example using tourism data
tourism_small <- tsibble::tourism |>
dplyr::filter(Region == "Melbourne") |> 
fabletools::aggregate_key(Purpose, Trips = sum(Trips))

fit <- tourism_small |> 
model(base = ETS(Trips ~ trend("A") + season("A"))) |>
reconcile(recon = bayesRecon_t(base))

fc <- forecast(fit, h = "2 years")
fc


}
\references{
Carrara, C., Corani, G., Azzimonti, D., & Zambon, L. (2025). Modeling the uncertainty on the covariance
matrix for probabilistic forecast reconciliation. arXiv preprint arXiv:2506.19554.
\url{https://arxiv.org/abs/2506.19554}
}
\seealso{
\code{\link[fabletools:reconcile]{fabletools::reconcile()}}, \code{\link[fabletools:aggregate_key]{fabletools::aggregate_key()}},
\code{\link[fabletools:min_trace]{fabletools::min_trace()}}, \code{\link[bayesRecon:reconc_t]{bayesRecon::reconc_t()}}
}
