core.HierarchicalForecast
capabilities class. Check their usage example
here.
1. Normality
Normality
sampler input as other HierarchicalForecast reconciliation classes.
Given base forecasts under a normal distribution:
The reconciled forecasts are also normally distributed:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
S | Union[ndarray, spmatrix] | np.array, summing matrix of size (base, bottom). | required |
P | Union[ndarray, spmatrix] | np.array, reconciliation matrix of size (bottom, base). | required |
y_hat | ndarray | Point forecasts values of size (base, horizon). | required |
W | Union[ndarray, spmatrix] | np.array, hierarchical covariance matrix of size (base, base). | required |
sigmah | ndarray | np.array, forecast standard dev. of size (base, horizon). | required |
seed | int | int, random seed for numpy generator’s replicability. Default is 0. | 0 |
Normality.get_samples
| Name | Type | Description | Default |
|---|---|---|---|
num_samples | int | number of samples generated from coherent distribution. | required |
| Name | Type | Description |
|---|---|---|
samples | ndarray | Coherent samples of size (base, horizon, num_samples). |
2. Bootstrap
Bootstrap
sampler
input as other HierarchicalForecast reconciliation classes.
Given a boostraped set of simulated sample paths:
The reconciled sample paths allow for reconciled distributional forecasts:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
S | Union[ndarray, spmatrix] | np.array, summing matrix of size (base, bottom). | required |
P | Union[ndarray, spmatrix] | np.array, reconciliation matrix of size (bottom, base). | required |
y_hat | ndarray | Point forecasts values of size (base, horizon). | required |
y_insample | ndarray | Insample values of size (base, insample_size). | required |
y_hat_insample | ndarray | Insample point forecasts of size (base, insample_size). | required |
num_samples | int | int, number of bootstraped samples generated. | 100 |
seed | int | int, random seed for numpy generator’s replicability. | 0 |
Bootstrap.get_samples
| Name | Type | Description | Default |
|---|---|---|---|
num_samples | int | int, number of samples generated from coherent distribution. | required |
| Name | Type | Description |
|---|---|---|
samples | Coherent samples of size (base, horizon, num_samples). |
3. PERMBU
PERMBU
- For all series compute conditional marginals distributions.
- Compute residuals and obtain rank permutations.
- Obtain K-sample from the bottom-level series predictions.
- Apply recursively through the hierarchical structure: 4.1. For a given aggregate series and its children series: 4.2. Obtain children’s empirical joint using sample reordering copula. 4.2. From the children’s joint obtain the aggregate series’s samples.
| Name | Type | Description | Default |
|---|---|---|---|
S | array | summing matrix of size (base, bottom). | required |
tags | dict[str, ndarray] | Each key is a level and each value its S indices. | required |
y_insample | array | Insample values of size (base, insample_size). | required |
y_hat_insample | array | Insample point forecasts of size (base, insample_size). | required |
sigmah | array | forecast standard dev. of size (base, horizon). | required |
num_samples | int | number of normal prediction samples generated. Default is None | None |
seed | int | random seed for numpy generator’s replicability. Default is 0. | 0 |
PERMBU.get_samples
| Name | Type | Description | Default |
|---|---|---|---|
num_samples | int | number of samples generated from coherent distribution. | None |
| Name | Type | Description |
|---|---|---|
samples | ndarray | Coherent samples of size (base, horizon, num_samples). |
References
- Rob J. Hyndman and George Athanasopoulos (2018). “Forecasting principles and practice, Reconciled distributional forecasts”.
- Puwasala Gamakumara Ph. D. dissertation. Monash University, Econometrics and Business Statistics (2020). “Probabilistic Forecast Reconciliation”
- Panagiotelis A., Gamakumara P. Athanasopoulos G., and Hyndman R. J. (2022). “Probabilistic forecast reconciliation: Properties, evaluation and score optimisation”. European Journal of Operational Research.
- Taieb, Souhaib Ben and Taylor, James W and Hyndman, Rob J. (2017). Coherent probabilistic forecasts for hierarchical time series. International conference on machine learning ICML.

