This notebook offers a step by step guide to create a hierarchical forecasting pipeline.
In the pipeline we will use
NeuralForecast
and
HINT
class, to create fit, predict and reconcile forecasts.
We will use the TourismL dataset that summarizes large Australian national visitor survey.
Outline
1. Installing packages
2. Load hierarchical dataset
3. Fit and Predict HINT
4. Benchmark methods
5. Forecast
Evaluation
You can run these experiments using GPU with Google Colab.
This detailed Australian Tourism Dataset comes from the National Visitor Survey, managed by the Tourism Research Australia, it is composed of 555 monthly series from 1998 to 2016, it is organized geographically, and purpose of travel. The natural geographical hierarchy comprises seven states, divided further in 27 zones and 76 regions. The purpose of travel categories are holiday, visiting friends and relatives (VFR), business and other. The MinT (Wickramasuriya et al., 2019), among other hierarchical forecasting studies has used the dataset it in the past. The dataset can be accessed in the MinT reconciliation webpage, although other sources are available.
Geographical Division | Number of series per division | Number of series per purpose | Total |
---|---|---|---|
Australia | 1 | 4 | 5 |
States | 7 | 28 | 35 |
Zones | 27 | 108 | 135 |
Regions | 76 | 304 | 380 |
Total | 111 | 444 | 555 |
Mathematically a hierarchical multivariate time series can be denoted by the vector defined by the following aggregation constraint:
where are the aggregate series, are the bottom level series and are the hierarchical aggregation constraints.
The Hierarchical Forecast Network (HINT) combines into an easy to use
model three components:
1. SoTA neural forecast model.
2. An
efficient and flexible multivariate probability distribution.
3.
Builtin reconciliation capabilities.
We compare against AutoARIMA, a well-established traditional forecasting method from the StatsForecast package, for which we reconcile the forecasts using HierarchicalForecast.
We define the model, and create the forecasts.
Next, we reconcile the forecasts using BottomUp
and MinTrace
reconciliation techniques:
To evaluate the coherent probabilistic predictions we use the scaled Continuous Ranked Probability Score (sCRPS), defined as follows:
As you can see the HINT model (using NHITS as base model) efficiently achieves state of the art accuracy under minimal tuning.
level | metric | NHITS | AutoARIMA | |
---|---|---|---|---|
0 | Country | scaled_crps | 0.044431 | 0.131136 |
1 | Country/State | scaled_crps | 0.063411 | 0.147516 |
2 | Country/State/Zone | scaled_crps | 0.106060 | 0.174071 |
3 | Country/State/Zone/Region | scaled_crps | 0.151988 | 0.205654 |
4 | Country/Purpose | scaled_crps | 0.075821 | 0.133664 |
5 | Country/State/Purpose | scaled_crps | 0.114674 | 0.181850 |
6 | Country/State/Zone/Purpose | scaled_crps | 0.180491 | 0.244324 |
7 | Country/State/Zone/Region/Purpose | scaled_crps | 0.245466 | 0.310656 |
8 | Overall | scaled_crps | 0.122793 | 0.191109 |
This notebook offers a step by step guide to create a hierarchical forecasting pipeline.
In the pipeline we will use
NeuralForecast
and
HINT
class, to create fit, predict and reconcile forecasts.
We will use the TourismL dataset that summarizes large Australian national visitor survey.
Outline
1. Installing packages
2. Load hierarchical dataset
3. Fit and Predict HINT
4. Benchmark methods
5. Forecast
Evaluation
You can run these experiments using GPU with Google Colab.
This detailed Australian Tourism Dataset comes from the National Visitor Survey, managed by the Tourism Research Australia, it is composed of 555 monthly series from 1998 to 2016, it is organized geographically, and purpose of travel. The natural geographical hierarchy comprises seven states, divided further in 27 zones and 76 regions. The purpose of travel categories are holiday, visiting friends and relatives (VFR), business and other. The MinT (Wickramasuriya et al., 2019), among other hierarchical forecasting studies has used the dataset it in the past. The dataset can be accessed in the MinT reconciliation webpage, although other sources are available.
Geographical Division | Number of series per division | Number of series per purpose | Total |
---|---|---|---|
Australia | 1 | 4 | 5 |
States | 7 | 28 | 35 |
Zones | 27 | 108 | 135 |
Regions | 76 | 304 | 380 |
Total | 111 | 444 | 555 |
Mathematically a hierarchical multivariate time series can be denoted by the vector defined by the following aggregation constraint:
where are the aggregate series, are the bottom level series and are the hierarchical aggregation constraints.
The Hierarchical Forecast Network (HINT) combines into an easy to use
model three components:
1. SoTA neural forecast model.
2. An
efficient and flexible multivariate probability distribution.
3.
Builtin reconciliation capabilities.
We compare against AutoARIMA, a well-established traditional forecasting method from the StatsForecast package, for which we reconcile the forecasts using HierarchicalForecast.
We define the model, and create the forecasts.
Next, we reconcile the forecasts using BottomUp
and MinTrace
reconciliation techniques:
To evaluate the coherent probabilistic predictions we use the scaled Continuous Ranked Probability Score (sCRPS), defined as follows:
As you can see the HINT model (using NHITS as base model) efficiently achieves state of the art accuracy under minimal tuning.
level | metric | NHITS | AutoARIMA | |
---|---|---|---|---|
0 | Country | scaled_crps | 0.044431 | 0.131136 |
1 | Country/State | scaled_crps | 0.063411 | 0.147516 |
2 | Country/State/Zone | scaled_crps | 0.106060 | 0.174071 |
3 | Country/State/Zone/Region | scaled_crps | 0.151988 | 0.205654 |
4 | Country/Purpose | scaled_crps | 0.075821 | 0.133664 |
5 | Country/State/Purpose | scaled_crps | 0.114674 | 0.181850 |
6 | Country/State/Zone/Purpose | scaled_crps | 0.180491 | 0.244324 |
7 | Country/State/Zone/Region/Purpose | scaled_crps | 0.245466 | 0.310656 |
8 | Overall | scaled_crps | 0.122793 | 0.191109 |