smooth.MSARIMA.reforecast
- MSARIMA.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 callsreapply()to obtain per-draw refitted states, samples per-distribution errors and occurrence draws, then runs the shared C++adamCore::reforecastkernel 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 allnsim*nsimpaths 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<=0returns fitted-period CIs fromreapply().X (
Optional[NDArray]) – Future exogenous regressors (xreg). Phase 2 raisesNotImplementedErrorif the fitted model has xreg.occurrence (
Optional[NDArray]) – Future occurrence probabilities. Phase 2 raisesNotImplementedErrorif 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 toreapply()(which forwards them tovcov()).heuristics (
Optional[float]) – Forwarded toreapply()(which forwards them tovcov()).**vcov_kwargs – Forwarded to
reapply()(which forwards them tovcov()).seed (
Optional[int]) – Forwarded toreapply()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,pathsandmodel.- Return type:
ReforecastResult
Parent Class: MSARIMA