% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/bayesRecon_BUIS.R
\name{bayesRecon_BUIS}
\alias{bayesRecon_BUIS}
\title{BUIS for probabilistic reconciliation of forecasts via conditioning}
\usage{
bayesRecon_BUIS(models, n_samples = 1000)
}
\arguments{
\item{models}{A list of fitted models to reconcile.}

\item{n_samples}{Number of samples to draw from the reconciled distribution.}
}
\value{
A model specification of class \code{"bayesRecon_BUIS"}
(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_sample}}).
}
\description{
Specifies Bottom-Up Importance Sampling (BUIS) reconciliation for use within
\code{reconcile()}. The method uses the Bottom-Up Importance Sampling algorithm
to draw samples from the reconciled forecast distribution, obtained via conditioning.
Reconciliation is performed when \code{forecast()} is called on the resulting model.
Marginal reconciled forecasts follow a sample 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_BUIS(base, n_samples = 300))

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

}
\references{
Zambon, L., Azzimonti, D. & Corani, G. (2024).
\emph{Efficient probabilistic reconciliation of forecasts for real-valued and count time series}.
Statistics and Computing 34 (1), 21.
\doi{10.1007/s11222-023-10343-y}.
}
\seealso{
\code{\link[fabletools:reconcile]{fabletools::reconcile()}}, \code{\link[fabletools:aggregate_key]{fabletools::aggregate_key()}}, \code{\link[=bayesRecon_MixCond]{bayesRecon_MixCond()}}, \code{\link[bayesRecon:reconc_BUIS]{bayesRecon::reconc_BUIS()}}
}
