Skip to main content

forecast.back_transform()

forecast (on the model’s scale) on the target’s scale, through the resolved chain.

Usage

Source

forecast.back_transform(
    forecast,
    chain,
    history=None,
    *,
    residuals=None,
    correction="auto",
    draws=2000,
    seed=0
)

history is the target in levels up to the origin (needed by a chain with a lag). A linear chain (differences) needs no correction: the mean is the inverse of the mean, and the bounds add the horizons’ variances, errors taken independent. A chain without lags inverts the bounds; its mean is corrected by smearing (the inverse averaged over the model’s residuals; Duan’s factor for a log) or simulation (averaged over draws normal errors with the forecast’s standard error, from the widest interval, seeded by seed). A nonlinear chain with a lag is simulated, its bounds the simulated quantiles. auto picks none, smearing for a log or Box-Cox, simulation for a logit or a lag.