Esc
Ask AIAnswers may be inaccurate; check the linked pages.Esc
Ask anything about these docs, like how to get started or what a function does.

ADIDA

chronax.adida.ADIDA · inherits BaseForecaster

Aggregate-Dissagregate Intermittent Demand Approach: Uses temporal aggregation to reduce the number of zero observations. Once the data has been agregated, it uses the optimized SES to generate the forecasts at the new level. It then breaks down the forecast to the original level using equal weights. ADIDA specializes on sparse or intermittent series are series with very few non-zero observations. They are notoriously hard to forecast, and so, different methods have been developed especifically for them.

__init__(self, alias='ADIDA', prediction_intervals=None)

Initializes the ADIDA model.

Parameter Type Default Description
alias str 'ADIDA' Custom name of the model.
prediction_intervals Optional[ConformalIntervals] None Information to compute conformal prediction intervals. By default, the model will compute the native prediction intervals.

Attributes: * alias: Custom name of the model. * conformal_params: Stores the prediction_intervals configuration. * model_: Stores the fitted state (mean forecast) after calling fit().

fit(self, y, X=None) -> Self

Fit an ADIDA to a time series (y).

Parameter Type Default Description
y jnp.ndarray - Clean time series of shape (t, ).
X Optional[jnp.ndarray] None Optional exogenous variables.

Returns: Self (the fitted forecaster; sets self.model_).

predict(self, h, X=None, level=None) -> Dict[str, jnp.ndarray]

Predict with fitted ADIDA.

Parameter Type Default Description
h int - Forecast horizon.
X Optional[jnp.ndarray] None Optional exogenous of shape (h, n_x).
level Optional[List[int]] None Confidence levels (0-100) for prediction intervals.

Returns: dict (Dictionary with entries mean for point predictions and level_* for probabilistic predictions.)

predict_in_sample(self, level=None) -> Dict[str, jnp.ndarray]

Access fitted ADIDA insample predictions.

Parameter Type Default Description
level Optional[List[int]] None Confidence levels (0-100) for prediction intervals.

Returns: dict (Dictionary with entries fitted for point predictions and level_* for probabilistic predictions.)

forecast(self, y, h, X=None, X_future=None, level=None, fitted=False) -> Dict[str, jnp.ndarray]

Memory Efficient ADIDA predictions.

This method avoids memory burden due from object storage. It is analogous to fit_predict without storing information. It assumes you know the forecast horizon in advance.

Parameter Type Default Description
y jnp.ndarray - Clean time series of shape (n,).
h int - Forecast horizon.
X Optional[jnp.ndarray] None Optional insample exogenous of shape (t, n_x).
X_future Optional[jnp.ndarray] None Optional exogenous of shape (h, n_x).
level Optional[List[int]] None Confidence levels (0-100) for prediction intervals.
fitted bool False Whether or not to return insample predictions.

Returns: dict (Dictionary with entries mean for point predictions and level_* for probabilistic predictions.)