Back to models
Transformer

OptimalReconciler

Inverse transformUnequal length

Reconciliation for hierarchical time series.

Uses all the forecasts to obtain a reconciled forecast. Uses the constraint matrix approach, which is more efficient than the projection one.

If the dataframe is not hierarchical, this works as identity.

Quickstart

python
from sktime.transformations.hierarchical.reconcile import OptimalReconciler

estimator = OptimalReconciler(error_covariance_matrix: DataFrame=None, alpha=0)

Parameters(2)

error_covariance_matrixpd.DataFrame, default=None
Error covariance matrix. If None, it is assumed to be the identity matrix.
alphafloat, default=0
Constant added to the diagonal of the inverted matrix.

Examples

>>> from sktime.transformations.hierarchical.reconcile import (
... OptimalReconciler)
>>> from sktime.utils._testing.hierarchical import _make_hierarchical
>>> from sktime.forecasting.naive import NaiveForecaster
>>> y = _make_hierarchical ()
>>> pipe = OptimalReconciler () * NaiveForecaster ()
>>> pipe = pipe. fit (y)
>>> y_pred = pipe. predict (fh = [1, 2, 3 ])