smooth.OM.reforecast

OM.reforecast(h=10, X=None, occurrence=None, interval='prediction', level=0.95, side='both', cumulative=False, nsim=100, type=None, bootstrap=False, heuristics=None, seed=None, trim=0.01, **vcov_kwargs)

Produce h-step-ahead forecasts via Monte-Carlo reforecasting.

Python port of R’s reforecast.adam (R/reapply.R:941-1402). Internally calls reapply() to obtain per-draw refitted states, samples per-distribution errors and occurrence draws, then runs the shared C++ adamCore::reforecast kernel to produce an (h, nsim, nsim) cube of trajectories. The cube is reduced to a point forecast (trimmed mean across all paths) and one of two interval flavours:

  • interval="prediction" — quantile across all nsim*nsim paths per horizon step (parameter + prediction uncertainty mixed).

  • interval="confidence" — for each error sample, average across parameter sets first, then quantile across error samples (parameter uncertainty only, conditional on a marginalised error path).

Parameters:
  • h (int) – Forecast horizon. h<=0 returns fitted-period CIs from reapply().

  • X (Optional[NDArray]) – Future exogenous regressors (xreg). Phase 2 raises NotImplementedError if the fitted model has xreg.

  • occurrence (Optional[NDArray]) – Future occurrence probabilities. Phase 2 raises NotImplementedError if the fitted model has an occurrence model.

  • interval (Literal['prediction', 'confidence', 'none']) – Interval type. "none" returns only the point forecast.

  • level (Union[float, list]) – Confidence level(s). Values above 1 are interpreted as percentages (e.g. 95 -> 0.95).

  • side (Literal['both', 'upper', 'lower']) – Which side(s) of the interval to compute.

  • cumulative (bool) – If True, sum trajectories over the horizon and return a length-1 point + interval.

  • nsim (int) – Number of parameter draws (the cube is (h, nsim, nsim)).

  • bootstrap (bool) – Forwarded to reapply() (which forwards them to vcov()).

  • heuristics (Optional[float]) – Forwarded to reapply() (which forwards them to vcov()).

  • **vcov_kwargs – Forwarded to reapply() (which forwards them to vcov()).

  • seed (Optional[int]) – Forwarded to reapply() for reproducible draws.

  • trim (float) – Trim proportion for the point-forecast mean (R uses 1% by default).

Returns:

Container with mean, lower, upper, level, interval, side, cumulative, h, paths and model.

Return type:

ReforecastResult


Parent Class: OM