Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions datasetsforecast/index.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Datasets for time series forecasting
title: "datasetsforecast"

Check warning on line 3 in datasetsforecast/index.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

datasetsforecast/index.mdx#L3

Did you really mean 'datasetsforecast'?
---
## Install

Expand All @@ -10,14 +10,13 @@

## Datasets

- [Favorita](https://nixtlaverse.nixtla.io/datasetsforecast/favorita.html)
- [Hierarchical](https://nixtlaverse.nixtla.io/datasetsforecast/hierarchical.html)
- [Long
horizon](https://nixtlaverse.nixtla.io/datasetsforecast/long_horizon.html)
- [M3](https://nixtlaverse.nixtla.io/datasetsforecast/m3.html)
- [M4](https://nixtlaverse.nixtla.io/datasetsforecast/m4.html)
- [M5](https://nixtlaverse.nixtla.io/datasetsforecast/m5.html)
- [PHM2008](https://nixtlaverse.nixtla.io/datasetsforecast/phm2008.html)
- [Favorita](favorita)
- [Hierarchical](hierarchical)
- [Long horizon](long_horizon)
- [M3](m3)
- [M4](m4)
- [M5](m5)
- [PHM2008](phm2008)

## How to use

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
Y_df.head()
```

| | Country | Region | State | Purpose | ds | y |

Check warning on line 53 in hierarchicalforecast/examples/australiandomestictourism-bootstraped-intervals.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism-bootstraped-intervals.html.mdx#L53

Did you really mean 'ds'?
|-----|-----------|----------|-----------------|----------|------------|------------|
| 0 | Australia | Adelaide | South Australia | Business | 1998-01-01 | 135.077690 |
| 1 | Australia | Adelaide | South Australia | Business | 1998-04-01 | 109.987316 |
Expand All @@ -74,11 +74,11 @@
```

Using the
[`aggregate`](https://Nixtla.github.io/hierarchicalforecast/src/utils.html#aggregate)
[`aggregate`](src/utils.html#aggregate)
function from `HierarchicalForecast` we can generate: 1. `Y_df`: the
hierarchical structured series $\mathbf{y}_{[a,b]\tau}$ 2. `S_df`: the
aggregation constraings dataframe with $S_{[a,b]}$ 3. `tags`: a list

Check warning on line 80 in hierarchicalforecast/examples/australiandomestictourism-bootstraped-intervals.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism-bootstraped-intervals.html.mdx#L80

Did you really mean 'constraings'?

Check warning on line 80 in hierarchicalforecast/examples/australiandomestictourism-bootstraped-intervals.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism-bootstraped-intervals.html.mdx#L80

Did you really mean 'dataframe'?
with the ‘unique_ids’ conforming each aggregation level.

Check warning on line 81 in hierarchicalforecast/examples/australiandomestictourism-bootstraped-intervals.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism-bootstraped-intervals.html.mdx#L81

Did you really mean 'unique_ids'?


```python
Expand All @@ -90,7 +90,7 @@
Y_df.head()
```

| | unique_id | ds | y |

Check warning on line 93 in hierarchicalforecast/examples/australiandomestictourism-bootstraped-intervals.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism-bootstraped-intervals.html.mdx#L93

Did you really mean 'ds'?
|-----|-----------|------------|--------------|
| 0 | Australia | 1998-01-01 | 23182.197269 |
| 1 | Australia | 1998-04-01 | 20323.380067 |
Expand Down Expand Up @@ -122,7 +122,7 @@
```

We can visualize the `S_df` dataframe and `Y_df` using the
[`HierarchicalPlot`](https://Nixtla.github.io/hierarchicalforecast/src/utils.html#hierarchicalplot)
[`HierarchicalPlot`](src/utils.html#hierarchicalplot)
class as follows.


Expand Down Expand Up @@ -163,7 +163,7 @@
```

``` text
unique_id

Check warning on line 166 in hierarchicalforecast/examples/australiandomestictourism-bootstraped-intervals.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism-bootstraped-intervals.html.mdx#L166

Did you really mean 'unique_id'?
Australia 72
Australia/ACT 72
Australia/ACT/Business 72
Expand Down Expand Up @@ -197,16 +197,16 @@
## Reconcile Base Forecasts

The following cell makes the previous forecasts coherent using the
[`HierarchicalReconciliation`](https://Nixtla.github.io/hierarchicalforecast/src/core.html#hierarchicalreconciliation)
[`HierarchicalReconciliation`](src/core.html#hierarchicalreconciliation)
class. Since the hierarchy structure is not strict, we can’t use methods
such as
[`TopDown`](https://Nixtla.github.io/hierarchicalforecast/src/methods.html#topdown)
[`TopDown`](src/methods.html#topdown)
or
[`MiddleOut`](https://Nixtla.github.io/hierarchicalforecast/src/methods.html#middleout).
[`MiddleOut`](src/methods.html#middleout).
In this example we use
[`BottomUp`](https://Nixtla.github.io/hierarchicalforecast/src/methods.html#bottomup)
[`BottomUp`](src/methods.html#bottomup)
and
[`MinTrace`](https://Nixtla.github.io/hierarchicalforecast/src/methods.html#mintrace).
[`MinTrace`](src/methods.html#mintrace).
If you want to calculate prediction intervals, you have to use the
`level` argument as follows and set `intervals_method='bootstrap'`.

Expand All @@ -230,7 +230,7 @@
Y_rec_df.head()
```

| | unique_id | ds | AutoETS | AutoETS/BottomUp | AutoETS/BottomUp-lo-90 | AutoETS/BottomUp-lo-80 | AutoETS/BottomUp-hi-80 | AutoETS/BottomUp-hi-90 | AutoETS/MinTrace_method-mint_shrink | AutoETS/MinTrace_method-mint_shrink-lo-90 | AutoETS/MinTrace_method-mint_shrink-lo-80 | AutoETS/MinTrace_method-mint_shrink-hi-80 | AutoETS/MinTrace_method-mint_shrink-hi-90 | AutoETS/MinTrace_method-ols | AutoETS/MinTrace_method-ols-lo-90 | AutoETS/MinTrace_method-ols-lo-80 | AutoETS/MinTrace_method-ols-hi-80 | AutoETS/MinTrace_method-ols-hi-90 |

Check warning on line 233 in hierarchicalforecast/examples/australiandomestictourism-bootstraped-intervals.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism-bootstraped-intervals.html.mdx#L233

Did you really mean 'unique_id'?

Check warning on line 233 in hierarchicalforecast/examples/australiandomestictourism-bootstraped-intervals.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism-bootstraped-intervals.html.mdx#L233

Did you really mean 'ds'?
|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|
| 0 | Australia | 2016-01-01 | 26080.878488 | 24487.152503 | 23242.757311 | 23332.592968 | 25379.829486 | 25424.139137 | 25521.551706 | 24407.442712 | 24698.931479 | 26357.024354 | 26466.740682 | 26034.132091 | 24914.199038 | 25100.470502 | 27102.746065 | 27176.467048 |
| 1 | Australia | 2016-04-01 | 24587.012115 | 23068.314292 | 21823.919100 | 21910.615057 | 23945.982949 | 24278.683243 | 24106.522479 | 23185.403634 | 23283.902251 | 25098.332342 | 25473.239949 | 24567.457913 | 23483.983814 | 23640.627126 | 25709.792870 | 25809.220444 |
Expand Down Expand Up @@ -276,7 +276,7 @@

![](/hierarchicalforecast/examples/AustralianDomesticTourism-Bootstraped-Intervals_files/figure-markdown_strict/cell-20-output-1.png)

### Plot hierarchichally linked time series

Check warning on line 279 in hierarchicalforecast/examples/australiandomestictourism-bootstraped-intervals.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism-bootstraped-intervals.html.mdx#L279

Did you really mean 'hierarchichally'?


```python
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
Y_df.head()
```

| | Country | Region | State | Purpose | ds | y |

Check warning on line 53 in hierarchicalforecast/examples/australiandomestictourism-intervals.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism-intervals.html.mdx#L53

Did you really mean 'ds'?
|-----|-----------|----------|-----------------|----------|------------|------------|
| 0 | Australia | Adelaide | South Australia | Business | 1998-01-01 | 135.077690 |
| 1 | Australia | Adelaide | South Australia | Business | 1998-04-01 | 109.987316 |
Expand All @@ -74,11 +74,11 @@
```

Using the
[`aggregate`](https://Nixtla.github.io/hierarchicalforecast/src/utils.html#aggregate)
[`aggregate`](src/utils.html#aggregate)
function from `HierarchicalForecast` we can generate: 1. `Y_df`: the
hierarchical structured series $\mathbf{y}_{[a,b]\tau}$ 2. `S_df`: the
aggregation constraings dataframe with $S_{[a,b]}$ 3. `tags`: a list

Check warning on line 80 in hierarchicalforecast/examples/australiandomestictourism-intervals.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism-intervals.html.mdx#L80

Did you really mean 'constraings'?

Check warning on line 80 in hierarchicalforecast/examples/australiandomestictourism-intervals.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism-intervals.html.mdx#L80

Did you really mean 'dataframe'?
with the ‘unique_ids’ conforming each aggregation level.

Check warning on line 81 in hierarchicalforecast/examples/australiandomestictourism-intervals.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism-intervals.html.mdx#L81

Did you really mean 'unique_ids'?


```python
Expand All @@ -90,7 +90,7 @@
Y_df.head()
```

| | unique_id | ds | y |

Check warning on line 93 in hierarchicalforecast/examples/australiandomestictourism-intervals.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism-intervals.html.mdx#L93

Did you really mean 'ds'?
|-----|-----------|------------|--------------|
| 0 | Australia | 1998-01-01 | 23182.197269 |
| 1 | Australia | 1998-04-01 | 20323.380067 |
Expand Down Expand Up @@ -122,7 +122,7 @@
```

We can visualize the `S` matrix and the data using the
[`HierarchicalPlot`](https://Nixtla.github.io/hierarchicalforecast/src/utils.html#hierarchicalplot)
[`HierarchicalPlot`](src/utils.html#hierarchicalplot)
class as follows.


Expand Down Expand Up @@ -163,7 +163,7 @@
```

``` text
unique_id

Check warning on line 166 in hierarchicalforecast/examples/australiandomestictourism-intervals.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism-intervals.html.mdx#L166

Did you really mean 'unique_id'?
Australia 72
Australia/ACT 72
Australia/ACT/Business 72
Expand All @@ -183,7 +183,7 @@
The following cell computes the **base forecasts** for each time series
in `Y_df` using the `AutoARIMA` and model. Observe that `Y_hat_df`
contains the forecasts but they are not coherent. To reconcile the
prediction intervals we need to calculate the uncoherent intervals using

Check warning on line 186 in hierarchicalforecast/examples/australiandomestictourism-intervals.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism-intervals.html.mdx#L186

Did you really mean 'uncoherent'?
the `level` argument of `StatsForecast`.


Expand All @@ -197,16 +197,16 @@
## Reconcile forecasts

The following cell makes the previous forecasts coherent using the
[`HierarchicalReconciliation`](https://Nixtla.github.io/hierarchicalforecast/src/core.html#hierarchicalreconciliation)
[`HierarchicalReconciliation`](src/core.html#hierarchicalreconciliation)
class. Since the hierarchy structure is not strict, we can’t use methods
such as
[`TopDown`](https://Nixtla.github.io/hierarchicalforecast/src/methods.html#topdown)
[`TopDown`](src/methods.html#topdown)
or
[`MiddleOut`](https://Nixtla.github.io/hierarchicalforecast/src/methods.html#middleout).
[`MiddleOut`](src/methods.html#middleout).
In this example we use
[`BottomUp`](https://Nixtla.github.io/hierarchicalforecast/src/methods.html#bottomup)
[`BottomUp`](src/methods.html#bottomup)
and
[`MinTrace`](https://Nixtla.github.io/hierarchicalforecast/src/methods.html#mintrace).
[`MinTrace`](src/methods.html#mintrace).
If you want to calculate prediction intervals, you have to use the
`level` argument as follows.

Expand All @@ -229,7 +229,7 @@
Y_rec_df.head()
```

| | unique_id | ds | AutoARIMA | AutoARIMA-lo-90 | AutoARIMA-lo-80 | AutoARIMA-hi-80 | AutoARIMA-hi-90 | AutoARIMA/BottomUp | AutoARIMA/BottomUp-lo-90 | AutoARIMA/BottomUp-lo-80 | ... | AutoARIMA/MinTrace_method-mint_shrink | AutoARIMA/MinTrace_method-mint_shrink-lo-90 | AutoARIMA/MinTrace_method-mint_shrink-lo-80 | AutoARIMA/MinTrace_method-mint_shrink-hi-80 | AutoARIMA/MinTrace_method-mint_shrink-hi-90 | AutoARIMA/MinTrace_method-ols | AutoARIMA/MinTrace_method-ols-lo-90 | AutoARIMA/MinTrace_method-ols-lo-80 | AutoARIMA/MinTrace_method-ols-hi-80 | AutoARIMA/MinTrace_method-ols-hi-90 |

Check warning on line 232 in hierarchicalforecast/examples/australiandomestictourism-intervals.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism-intervals.html.mdx#L232

Did you really mean 'unique_id'?

Check warning on line 232 in hierarchicalforecast/examples/australiandomestictourism-intervals.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism-intervals.html.mdx#L232

Did you really mean 'ds'?
|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|
| 0 | Australia | 2016-01-01 | 26212.553553 | 24705.948180 | 25038.715077 | 27386.392029 | 27719.158927 | 24646.517084 | 23983.656843 | 24130.064091 | ... | 25267.797338 | 24491.630618 | 24663.064091 | 25872.530586 | 26043.964058 | 26082.753488 | 25010.876141 | 25247.623803 | 26917.883174 | 27154.630835 |
| 1 | Australia | 2016-04-01 | 25033.667125 | 23337.267588 | 23711.954696 | 26355.379554 | 26730.066662 | 22942.957703 | 22229.916838 | 22387.407579 | ... | 23836.804444 | 23002.620214 | 23186.868128 | 24486.740760 | 24670.988674 | 24822.102094 | 23616.734393 | 23882.966332 | 25761.237857 | 26027.469796 |
Expand Down Expand Up @@ -276,7 +276,7 @@

![](/hierarchicalforecast/examples/AustralianDomesticTourism-Intervals_files/figure-markdown_strict/cell-20-output-1.png)

### Plot hierarchichally linked time series

Check warning on line 279 in hierarchicalforecast/examples/australiandomestictourism-intervals.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism-intervals.html.mdx#L279

Did you really mean 'hierarchichally'?


```python
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
`HistGradientBoostingRegressor` using `MLForecast`, and neural network
models like `NBEATS` from `NeuralForecast`. After generating these base
forecasts, we will reconcile them using
[`BottomUp`](https://Nixtla.github.io/hierarchicalforecast/src/methods.html#bottomup),
[`BottomUp`](src/methods.html#bottomup),
`MinTrace(mint_shrink)`, `TopDown(forecast_proportions)` reconciliators

Check warning on line 24 in hierarchicalforecast/examples/australiandomestictourism-multimodel.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism-multimodel.html.mdx#L24

Did you really mean 'reconciliators'?
from `HierarchicalForecast`.

You can run these experiments using CPU or GPU with Google Colab.

Check warning on line 27 in hierarchicalforecast/examples/australiandomestictourism-multimodel.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism-multimodel.html.mdx#L27

Did you really mean 'Colab'?

<a href='https://colab.research.google.com/github/Nixtla/hierarchicalforecast/blob/main/nbs/examples/AustralianDomesticTourism-Multimodel.ipynb' target='_parent'><img src='https://colab.research.google.com/assets/colab-badge.svg' alt='Open In Colab'/></a>

Expand Down Expand Up @@ -60,7 +60,7 @@
Y_df_first.head()
```

| | Country | Region | State | ds | y |

Check warning on line 63 in hierarchicalforecast/examples/australiandomestictourism-multimodel.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism-multimodel.html.mdx#L63

Did you really mean 'ds'?
|-----|-----------|----------|-----------------|------------|------------|
| 0 | Australia | Adelaide | South Australia | 1998-01-01 | 658.553895 |
| 1 | Australia | Adelaide | South Australia | 1998-04-01 | 449.853935 |
Expand All @@ -80,7 +80,7 @@
```

Using the
[`aggregate`](https://Nixtla.github.io/hierarchicalforecast/src/utils.html#aggregate)
[`aggregate`](src/utils.html#aggregate)
function from `HierarchicalForecast` we can get the full set of time
series.

Expand Down Expand Up @@ -176,9 +176,9 @@
```

To fit each model and create forecasts with it, we loop over the
timeseries that are present in each level of the hierarchy, using the

Check warning on line 179 in hierarchicalforecast/examples/australiandomestictourism-multimodel.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism-multimodel.html.mdx#L179

Did you really mean 'timeseries'?
`tags` we created earlier using the
[`aggregate`](https://Nixtla.github.io/hierarchicalforecast/src/utils.html#aggregate)
[`aggregate`](src/utils.html#aggregate)
function.


Expand Down Expand Up @@ -208,7 +208,7 @@
Y_hat_df.head(10)
```

| | unique_id | ds | AutoETS | HistGradientBoostingRegressor | NBEATS |

Check warning on line 211 in hierarchicalforecast/examples/australiandomestictourism-multimodel.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism-multimodel.html.mdx#L211

Did you really mean 'unique_id'?

Check warning on line 211 in hierarchicalforecast/examples/australiandomestictourism-multimodel.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism-multimodel.html.mdx#L211

Did you really mean 'ds'?
|----|----|----|----|----|----|
| 0 | Australia | 2016-01-01 | 25990.068004 | NaN | NaN |
| 1 | Australia | 2016-04-01 | 24458.490282 | NaN | NaN |
Expand All @@ -226,7 +226,7 @@
the level `Country` using `AutoETS`.

Secondly, we also only have forecasts using
`HistGradientBoostingRegressor` for timeseries in the level

Check warning on line 229 in hierarchicalforecast/examples/australiandomestictourism-multimodel.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism-multimodel.html.mdx#L229

Did you really mean 'timeseries'?
`Country/State`, again as we only created forecasts for the level
`Country/State` using `HistGradientBoostingRegressor`.

Expand All @@ -240,7 +240,7 @@
Y_hat_df.tail(10)
```

| | unique_id | ds | AutoETS | HistGradientBoostingRegressor | NBEATS |

Check warning on line 243 in hierarchicalforecast/examples/australiandomestictourism-multimodel.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism-multimodel.html.mdx#L243

Did you really mean 'unique_id'?

Check warning on line 243 in hierarchicalforecast/examples/australiandomestictourism-multimodel.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism-multimodel.html.mdx#L243

Did you really mean 'ds'?
|----|----|----|----|----|----|
| 670 | Australia/Western Australia/Australia's South ... | 2017-07-01 | NaN | NaN | 416.720154 |
| 671 | Australia/Western Australia/Australia's South ... | 2017-10-01 | NaN | NaN | 605.681030 |
Expand All @@ -259,7 +259,7 @@
the forecasts across all the levels, as we want to reconcile the
forecasts across the levels. We do so by taking the mean across the
forecast columns. In this case, because there’s only a single entry for
each unique_id, it would be equivalent to just combine or sum the

Check warning on line 262 in hierarchicalforecast/examples/australiandomestictourism-multimodel.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism-multimodel.html.mdx#L262

Did you really mean 'unique_id'?
forecast columns. However, you might want to use more than one model
*per level* in the hierarchy. In that case, you’d need to think about
how to ensemble the multiple forecasts - a simple mean ensemble
Expand All @@ -282,7 +282,7 @@
Y_hat_df.head(10)
```

| | unique_id | ds | AutoETS | HistGradientBoostingRegressor | NBEATS | all_forecasts |

Check warning on line 285 in hierarchicalforecast/examples/australiandomestictourism-multimodel.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism-multimodel.html.mdx#L285

Did you really mean 'unique_id'?

Check warning on line 285 in hierarchicalforecast/examples/australiandomestictourism-multimodel.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism-multimodel.html.mdx#L285

Did you really mean 'ds'?

Check warning on line 285 in hierarchicalforecast/examples/australiandomestictourism-multimodel.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism-multimodel.html.mdx#L285

Did you really mean 'all_forecasts'?
|----|----|----|----|----|----|----|
| 0 | Australia | 2016-01-01 | 25990.068004 | NaN | NaN | 25990.068004 |
| 1 | Australia | 2016-04-01 | 24458.490282 | NaN | NaN | 24458.490282 |
Expand All @@ -296,9 +296,9 @@
| 9 | Australia/ACT | 2016-04-01 | NaN | 548.060532 | NaN | 548.060532 |

We are now ready to make the forecasts coherent using the
[`HierarchicalReconciliation`](https://Nixtla.github.io/hierarchicalforecast/src/core.html#hierarchicalreconciliation)
[`HierarchicalReconciliation`](src/core.html#hierarchicalreconciliation)
class. In this example we use
[`BottomUp`](https://Nixtla.github.io/hierarchicalforecast/src/methods.html#bottomup),
[`BottomUp`](src/methods.html#bottomup),
`MinTrace(mint_shrink)`, `TopDown(forecast_proportions)` reconcilers.


Expand All @@ -325,7 +325,7 @@
Y_rec_df.head()
```

| | unique_id | ds | all_forecasts | all_forecasts/BottomUp | all_forecasts/MinTrace_method-mint_shrink | all_forecasts/TopDown_method-forecast_proportions |

Check warning on line 328 in hierarchicalforecast/examples/australiandomestictourism-multimodel.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism-multimodel.html.mdx#L328

Did you really mean 'unique_id'?

Check warning on line 328 in hierarchicalforecast/examples/australiandomestictourism-multimodel.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism-multimodel.html.mdx#L328

Did you really mean 'ds'?

Check warning on line 328 in hierarchicalforecast/examples/australiandomestictourism-multimodel.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism-multimodel.html.mdx#L328

Did you really mean 'all_forecasts'?
|----|----|----|----|----|----|----|
| 0 | Australia | 2016-01-01 | 25990.068004 | 24916.914513 | 25959.517939 | 25990.068004 |
| 1 | Australia | 2016-04-01 | 24458.490282 | 22867.133526 | 24656.012177 | 24458.490282 |
Expand All @@ -336,14 +336,14 @@
## 4. Evaluation

The `HierarchicalForecast` package includes an
[`evaluate`](https://Nixtla.github.io/hierarchicalforecast/src/evaluation.html#evaluate)
[`evaluate`](src/evaluation.html#evaluate)
function to evaluate the different hierarchies. To evaluate models we
use `mase` metric and compare it to base predictions.


```python
from hierarchicalforecast.evaluation import evaluate
from utilsforecast.losses import mase

Check warning on line 346 in hierarchicalforecast/examples/australiandomestictourism-multimodel.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism-multimodel.html.mdx#L346

Did you really mean 'mase'?
from functools import partial
```

Expand All @@ -366,11 +366,11 @@
evaluation
```

| | level | metric | all_forecasts | all_forecasts/BottomUp | all_forecasts/MinTrace_method-mint_shrink | all_forecasts/TopDown_method-forecast_proportions |

Check warning on line 369 in hierarchicalforecast/examples/australiandomestictourism-multimodel.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism-multimodel.html.mdx#L369

Did you really mean 'all_forecasts'?
|----|----|----|----|----|----|----|
| 0 | Total | mase | 1.589074 | 3.002085 | 0.440261 | 1.589074 |

Check warning on line 371 in hierarchicalforecast/examples/australiandomestictourism-multimodel.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism-multimodel.html.mdx#L371

Did you really mean 'mase'?
| 1 | State | mase | 2.166374 | 1.905035 | 1.882345 | 2.361169 |

Check warning on line 372 in hierarchicalforecast/examples/australiandomestictourism-multimodel.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism-multimodel.html.mdx#L372

Did you really mean 'mase'?
| 2 | Regions | mase | 1.342429 | 1.342429 | 1.423867 | 1.458773 |

Check warning on line 373 in hierarchicalforecast/examples/australiandomestictourism-multimodel.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism-multimodel.html.mdx#L373

Did you really mean 'mase'?
| 3 | Overall | mase | 1.422878 | 1.414905 | 1.455446 | 1.545237 |

We find that:
Expand All @@ -383,7 +383,7 @@
upper levels of the hierarchy, reducing the MASE from 1.59 (base
forecast) to just 0.44.
- **BottomUp for Country/State/Region and Overall**: The
[`BottomUp`](https://Nixtla.github.io/hierarchicalforecast/src/methods.html#bottomup)
[`BottomUp`](src/methods.html#bottomup)
method preserves only the NBEATS forecast of the most granular
**Country/State/Regions** level, and aggregates those forecasts for
the upper levels. It yields the **best Overall MASE score**.
Expand All @@ -404,10 +404,10 @@
We then combined the results into a single prediction.

For the reconciliation of the forecasts, we used
[`HierarchicalReconciliation`](https://Nixtla.github.io/hierarchicalforecast/src/core.html#hierarchicalreconciliation)
[`HierarchicalReconciliation`](src/core.html#hierarchicalreconciliation)
with three different methods:

- [`BottomUp`](https://Nixtla.github.io/hierarchicalforecast/src/methods.html#bottomup)
- [`BottomUp`](src/methods.html#bottomup)
- `MinTrace(method='mint_shrink')`
- `TopDown(method='forecast_proportions')`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
Y_df.head()
```

| | Country | Region | State | Purpose | ds | y |

Check warning on line 53 in hierarchicalforecast/examples/australiandomestictourism-permbu-intervals.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism-permbu-intervals.html.mdx#L53

Did you really mean 'ds'?
|-----|-----------|----------|-----------------|----------|------------|------------|
| 0 | Australia | Adelaide | South Australia | Business | 1998-01-01 | 135.077690 |
| 1 | Australia | Adelaide | South Australia | Business | 1998-04-01 | 109.987316 |
Expand All @@ -71,7 +71,7 @@
```

Using the
[`aggregate`](https://Nixtla.github.io/hierarchicalforecast/src/utils.html#aggregate)
[`aggregate`](src/utils.html#aggregate)
function from `HierarchicalForecast` we can get the full set of time
series.

Expand All @@ -85,7 +85,7 @@
Y_df.head()
```

| | unique_id | ds | y |

Check warning on line 88 in hierarchicalforecast/examples/australiandomestictourism-permbu-intervals.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism-permbu-intervals.html.mdx#L88

Did you really mean 'ds'?
|-----|-----------|------------|--------------|
| 0 | Australia | 1998-01-01 | 23182.197269 |
| 1 | Australia | 1998-04-01 | 20323.380067 |
Expand Down Expand Up @@ -119,7 +119,7 @@
```

We can visualize the `S` matrix and the data using the
[`HierarchicalPlot`](https://Nixtla.github.io/hierarchicalforecast/src/utils.html#hierarchicalplot)
[`HierarchicalPlot`](src/utils.html#hierarchicalplot)
class as follows.


Expand Down Expand Up @@ -160,7 +160,7 @@
```

``` text
unique_id

Check warning on line 163 in hierarchicalforecast/examples/australiandomestictourism-permbu-intervals.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism-permbu-intervals.html.mdx#L163

Did you really mean 'unique_id'?
Australia 72
Australia/ACT 72
Australia/ACT/Canberra 72
Expand All @@ -180,7 +180,7 @@
The following cell computes the **base forecasts** for each time series
in `Y_df` using the `AutoARIMA` and model. Observe that `Y_hat_df`
contains the forecasts but they are not coherent. To reconcile the
prediction intervals we need to calculate the uncoherent intervals using

Check warning on line 183 in hierarchicalforecast/examples/australiandomestictourism-permbu-intervals.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism-permbu-intervals.html.mdx#L183

Did you really mean 'uncoherent'?
the `level` argument of `StatsForecast`.


Expand All @@ -194,11 +194,11 @@
## Reconcile forecasts and compute prediction intervals using PERMBU

The following cell makes the previous forecasts coherent using the
[`HierarchicalReconciliation`](https://Nixtla.github.io/hierarchicalforecast/src/core.html#hierarchicalreconciliation)
[`HierarchicalReconciliation`](src/core.html#hierarchicalreconciliation)
class. In this example we use
[`BottomUp`](https://Nixtla.github.io/hierarchicalforecast/src/methods.html#bottomup)
[`BottomUp`](src/methods.html#bottomup)
and
[`MinTrace`](https://Nixtla.github.io/hierarchicalforecast/src/methods.html#mintrace).
[`MinTrace`](src/methods.html#mintrace).
If you want to calculate prediction intervals, you have to use the
`level` argument as follows and also `intervals_method='permbu'`.

Expand All @@ -222,7 +222,7 @@
Y_rec_df.head()
```

| | unique_id | ds | AutoARIMA | AutoARIMA-lo-90 | AutoARIMA-lo-80 | AutoARIMA-hi-80 | AutoARIMA-hi-90 | AutoARIMA/BottomUp | AutoARIMA/BottomUp-lo-90 | AutoARIMA/BottomUp-lo-80 | ... | AutoARIMA/MinTrace_method-mint_shrink | AutoARIMA/MinTrace_method-mint_shrink-lo-90 | AutoARIMA/MinTrace_method-mint_shrink-lo-80 | AutoARIMA/MinTrace_method-mint_shrink-hi-80 | AutoARIMA/MinTrace_method-mint_shrink-hi-90 | AutoARIMA/MinTrace_method-ols | AutoARIMA/MinTrace_method-ols-lo-90 | AutoARIMA/MinTrace_method-ols-lo-80 | AutoARIMA/MinTrace_method-ols-hi-80 | AutoARIMA/MinTrace_method-ols-hi-90 |

Check warning on line 225 in hierarchicalforecast/examples/australiandomestictourism-permbu-intervals.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism-permbu-intervals.html.mdx#L225

Did you really mean 'unique_id'?

Check warning on line 225 in hierarchicalforecast/examples/australiandomestictourism-permbu-intervals.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism-permbu-intervals.html.mdx#L225

Did you really mean 'ds'?
|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|
| 0 | Australia | 2016-01-01 | 26212.553553 | 24705.948180 | 25038.715077 | 27386.392029 | 27719.158927 | 24955.501571 | 24143.056131 | 24387.230200 | ... | 25413.657606 | 24705.682710 | 24905.677772 | 25928.334367 | 26050.232961 | 26142.818016 | 25525.081721 | 25656.537995 | 26606.345032 | 26832.423921 |
| 1 | Australia | 2016-04-01 | 25033.667125 | 23337.267588 | 23711.954696 | 26355.379554 | 26730.066662 | 23421.312868 | 22762.045247 | 22904.087197 | ... | 24058.906411 | 23486.828548 | 23627.152623 | 24659.405484 | 24847.778503 | 24946.338649 | 24297.061230 | 24434.805048 | 25535.549040 | 25640.659918 |
Expand Down Expand Up @@ -256,7 +256,7 @@

![](/hierarchicalforecast/examples/AustralianDomesticTourism-Permbu-Intervals_files/figure-markdown_strict/cell-19-output-1.png)

### Plot hierarchichally linked time series

Check warning on line 259 in hierarchicalforecast/examples/australiandomestictourism-permbu-intervals.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism-permbu-intervals.html.mdx#L259

Did you really mean 'hierarchichally'?


```python
Expand Down
14 changes: 7 additions & 7 deletions hierarchicalforecast/examples/australiandomestictourism.html.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Examples include the presence of geographic levels, products, or
categories that define different types of aggregations. In such
scenarios, forecasters are often required to provide predictions for all
disaggregate and aggregate series. A natural desire is for those

Check warning on line 12 in hierarchicalforecast/examples/australiandomestictourism.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism.html.mdx#L12

Did you really mean 'disaggregate'?
predictions to be **“coherent”**, that is, for the bottom series to add
up precisely to the forecasts of the aggregated series.

Expand All @@ -20,14 +20,14 @@
visitors to each state of Australia.

We will first load the `Tourism` data and produce base forecasts using
an `AutoETS` model from `StatsForecast`, and then reconciliate the

Check warning on line 23 in hierarchicalforecast/examples/australiandomestictourism.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism.html.mdx#L23

Did you really mean 'reconciliate'?
forecasts with several reconciliation algorithms from
`HierarchicalForecast`. Finally, we show the performance is comparable
with the results reported by the [Forecasting: Principles and
Practice](https://otexts.com/fpp3/tourism.html) which uses the R package
[fable](https://github.com/tidyverts/fable).

You can run these experiments using CPU or GPU with Google Colab.

Check warning on line 30 in hierarchicalforecast/examples/australiandomestictourism.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism.html.mdx#L30

Did you really mean 'Colab'?

<a href="https://colab.research.google.com/github/Nixtla/hierarchicalforecast/blob/main/nbs/examples/AustralianDomesticTourism.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>

Expand Down Expand Up @@ -62,7 +62,7 @@
Y_df.head()
```

| | Country | Region | State | Purpose | ds | y |

Check warning on line 65 in hierarchicalforecast/examples/australiandomestictourism.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism.html.mdx#L65

Did you really mean 'ds'?
|-----|-----------|----------|-----------------|----------|------------|------------|
| 0 | Australia | Adelaide | South Australia | Business | 1998-01-01 | 135.077690 |
| 1 | Australia | Adelaide | South Australia | Business | 1998-04-01 | 109.987316 |
Expand All @@ -86,7 +86,7 @@
```

Using the
[`aggregate`](https://Nixtla.github.io/hierarchicalforecast/src/utils.html#aggregate)
[`aggregate`](src/utils.html#aggregate)
function from `HierarchicalForecast` we can get the full set of time
series.

Expand All @@ -105,7 +105,7 @@
Y_df.head()
```

| | unique_id | ds | y |

Check warning on line 108 in hierarchicalforecast/examples/australiandomestictourism.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism.html.mdx#L108

Did you really mean 'unique_id'?

Check warning on line 108 in hierarchicalforecast/examples/australiandomestictourism.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism.html.mdx#L108

Did you really mean 'ds'?
|-----|-----------|------------|--------------|
| 0 | Australia | 1998-01-01 | 23182.197269 |
| 1 | Australia | 1998-04-01 | 20323.380067 |
Expand All @@ -118,7 +118,7 @@
S_df.iloc[:5, :5]
```

| | unique_id | Australia/ACT/Canberra/Business | Australia/ACT/Canberra/Holiday | Australia/ACT/Canberra/Other | Australia/ACT/Canberra/Visiting |

Check warning on line 121 in hierarchicalforecast/examples/australiandomestictourism.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism.html.mdx#L121

Did you really mean 'unique_id'?
|----|----|----|----|----|----|
| 0 | Australia | 1.0 | 1.0 | 1.0 | 1.0 |
| 1 | Australia/ACT | 1.0 | 1.0 | 1.0 | 1.0 |
Expand Down Expand Up @@ -190,16 +190,16 @@
## 3. Reconcile forecasts

The following cell makes the previous forecasts coherent using the
[`HierarchicalReconciliation`](https://Nixtla.github.io/hierarchicalforecast/src/core.html#hierarchicalreconciliation)
[`HierarchicalReconciliation`](src/core.html#hierarchicalreconciliation)
class. Since the hierarchy structure is not strict, we can’t use methods
such as
[`TopDown`](https://Nixtla.github.io/hierarchicalforecast/src/methods.html#topdown)
[`TopDown`](src/methods.html#topdown)
or
[`MiddleOut`](https://Nixtla.github.io/hierarchicalforecast/src/methods.html#middleout).
[`MiddleOut`](src/methods.html#middleout).
In this example we use
[`BottomUp`](https://Nixtla.github.io/hierarchicalforecast/src/methods.html#bottomup)
[`BottomUp`](src/methods.html#bottomup)
and
[`MinTrace`](https://Nixtla.github.io/hierarchicalforecast/src/methods.html#mintrace).
[`MinTrace`](src/methods.html#mintrace).


```python
Expand All @@ -225,7 +225,7 @@
Y_rec_df.head()
```

| | unique_id | ds | AutoETS | AutoETS/BottomUp | AutoETS/MinTrace_method-mint_shrink | AutoETS/MinTrace_method-ols |

Check warning on line 228 in hierarchicalforecast/examples/australiandomestictourism.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism.html.mdx#L228

Did you really mean 'unique_id'?

Check warning on line 228 in hierarchicalforecast/examples/australiandomestictourism.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism.html.mdx#L228

Did you really mean 'ds'?
|----|----|----|----|----|----|----|
| 0 | Australia | 2016-01-01 | 25990.068004 | 24381.911737 | 25428.089783 | 25894.399067 |
| 1 | Australia | 2016-04-01 | 24458.490282 | 22903.895964 | 23914.271400 | 24357.301898 |
Expand All @@ -236,7 +236,7 @@
## 4. Evaluation

The `HierarchicalForecast` package includes an
[`evaluate`](https://Nixtla.github.io/hierarchicalforecast/src/evaluation.html#evaluate)
[`evaluate`](src/evaluation.html#evaluate)
function to evaluate the different hierarchies and also is capable of
compute scaled metrics compared to a benchmark model.

Expand Down Expand Up @@ -280,12 +280,12 @@

| | level | metric | Base | BottomUp | MinTrace(mint_shrink) | MinTrace(ols) |
|-----|---------|--------|---------|----------|-----------------------|---------------|
| 0 | Total | rmse | 1743.29 | 3028.62 | 2112.73 | 1818.94 |

Check warning on line 283 in hierarchicalforecast/examples/australiandomestictourism.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism.html.mdx#L283

Did you really mean 'rmse'?
| 2 | Purpose | rmse | 534.75 | 791.19 | 577.14 | 515.53 |

Check warning on line 284 in hierarchicalforecast/examples/australiandomestictourism.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism.html.mdx#L284

Did you really mean 'rmse'?
| 4 | State | rmse | 308.15 | 413.39 | 316.82 | 287.32 |

Check warning on line 285 in hierarchicalforecast/examples/australiandomestictourism.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism.html.mdx#L285

Did you really mean 'rmse'?
| 6 | Regions | rmse | 51.66 | 55.13 | 46.55 | 46.28 |

Check warning on line 286 in hierarchicalforecast/examples/australiandomestictourism.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism.html.mdx#L286

Did you really mean 'rmse'?
| 8 | Bottom | rmse | 19.37 | 19.37 | 17.80 | 18.19 |

Check warning on line 287 in hierarchicalforecast/examples/australiandomestictourism.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism.html.mdx#L287

Did you really mean 'rmse'?
| 10 | Overall | rmse | 41.12 | 49.82 | 40.47 | 38.75 |

Check warning on line 288 in hierarchicalforecast/examples/australiandomestictourism.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism.html.mdx#L288

Did you really mean 'rmse'?

### MASE

Expand All @@ -299,12 +299,12 @@

| | level | metric | Base | BottomUp | MinTrace(mint_shrink) | MinTrace(ols) |
|-----|---------|--------|------|----------|-----------------------|---------------|
| 1 | Total | mase | 1.59 | 3.16 | 2.06 | 1.67 |

Check warning on line 302 in hierarchicalforecast/examples/australiandomestictourism.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism.html.mdx#L302

Did you really mean 'mase'?
| 3 | Purpose | mase | 1.32 | 2.28 | 1.48 | 1.25 |

Check warning on line 303 in hierarchicalforecast/examples/australiandomestictourism.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism.html.mdx#L303

Did you really mean 'mase'?
| 5 | State | mase | 1.39 | 1.90 | 1.40 | 1.25 |

Check warning on line 304 in hierarchicalforecast/examples/australiandomestictourism.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism.html.mdx#L304

Did you really mean 'mase'?
| 7 | Regions | mase | 1.12 | 1.19 | 1.01 | 0.99 |

Check warning on line 305 in hierarchicalforecast/examples/australiandomestictourism.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism.html.mdx#L305

Did you really mean 'mase'?
| 9 | Bottom | mase | 0.98 | 0.98 | 0.94 | 1.01 |

Check warning on line 306 in hierarchicalforecast/examples/australiandomestictourism.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism.html.mdx#L306

Did you really mean 'mase'?
| 11 | Overall | mase | 1.02 | 1.06 | 0.97 | 1.02 |

Check warning on line 307 in hierarchicalforecast/examples/australiandomestictourism.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourism.html.mdx#L307

Did you really mean 'mase'?

### Comparison fable

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Examples include the presence of geographic levels, products, or
categories that define different types of aggregations. In such
scenarios, forecasters are often required to provide predictions for all
disaggregate and aggregate series. A natural desire is for those

Check warning on line 12 in hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx#L12

Did you really mean 'disaggregate'?
predictions to be **“coherent”**, that is, for the bottom series to add
up precisely to the forecasts of the aggregated series.

Expand All @@ -20,13 +20,13 @@
time series of the number of visitors to each state of Australia.

We will first load the `Tourism` data and produce base forecasts using
an `AutoETS` model from `StatsForecast`. Then, we reconciliate the

Check warning on line 23 in hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx#L23

Did you really mean 'reconciliate'?
forecasts with several reconciliation algorithms from
`HierarchicalForecast` according to the cross-sectional geographical
hierarchies. Finally, we reconciliate the forecasts in the temporal

Check warning on line 26 in hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx#L26

Did you really mean 'reconciliate'?
dimension according to a temporal hierarchy.

You can run these experiments using CPU or GPU with Google Colab.

Check warning on line 29 in hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx#L29

Did you really mean 'Colab'?

<a href="https://colab.research.google.com/github/Nixtla/hierarchicalforecast/blob/main/nbs/examples/AustralianDomesticTourismCrossTemporal.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>

Expand Down Expand Up @@ -61,7 +61,7 @@
Y_df.head()
```

| | Country | Region | State | Purpose | ds | y |

Check warning on line 64 in hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx#L64

Did you really mean 'ds'?
|-----|-----------|----------|-----------------|----------|------------|------------|
| 0 | Australia | Adelaide | South Australia | Business | 1998-01-01 | 135.077690 |
| 1 | Australia | Adelaide | South Australia | Business | 1998-04-01 | 109.987316 |
Expand Down Expand Up @@ -89,7 +89,7 @@
```

Using the
[`aggregate`](https://Nixtla.github.io/hierarchicalforecast/src/utils.html#aggregate)
[`aggregate`](src/utils.html#aggregate)
function from `HierarchicalForecast` we can get the full set of time
series.

Expand All @@ -108,7 +108,7 @@
Y_df_cs
```

| | unique_id | ds | y |

Check warning on line 111 in hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx#L111

Did you really mean 'unique_id'?

Check warning on line 111 in hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx#L111

Did you really mean 'ds'?
|----|----|----|----|
| 0 | Australia | 1998-01-01 | 23182.197269 |
| 1 | Australia | 1998-04-01 | 20323.380067 |
Expand All @@ -127,7 +127,7 @@
S_df_cs.iloc[:5, :5]
```

| | unique_id | Australia/ACT/Canberra/Business | Australia/ACT/Canberra/Holiday | Australia/ACT/Canberra/Other | Australia/ACT/Canberra/Visiting |

Check warning on line 130 in hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx#L130

Did you really mean 'unique_id'?
|----|----|----|----|----|----|
| 0 | Australia | 1.0 | 1.0 | 1.0 | 1.0 |
| 1 | Australia/ACT | 1.0 | 1.0 | 1.0 | 1.0 |
Expand Down Expand Up @@ -174,16 +174,16 @@
### 2d. Reconcile forecasts

The following cell makes the previous forecasts coherent using the
[`HierarchicalReconciliation`](https://Nixtla.github.io/hierarchicalforecast/src/core.html#hierarchicalreconciliation)
[`HierarchicalReconciliation`](src/core.html#hierarchicalreconciliation)
class. Since the hierarchy structure is not strict, we can’t use methods
such as
[`TopDown`](https://Nixtla.github.io/hierarchicalforecast/src/methods.html#topdown)
[`TopDown`](src/methods.html#topdown)
or
[`MiddleOut`](https://Nixtla.github.io/hierarchicalforecast/src/methods.html#middleout).
[`MiddleOut`](src/methods.html#middleout).
In this example we use
[`BottomUp`](https://Nixtla.github.io/hierarchicalforecast/src/methods.html#bottomup)
[`BottomUp`](src/methods.html#bottomup)
and
[`MinTrace`](https://Nixtla.github.io/hierarchicalforecast/src/methods.html#mintrace).
[`MinTrace`](src/methods.html#mintrace).


```python
Expand All @@ -209,7 +209,7 @@
Y_rec_df_cs.head()
```

| | unique_id | ds | AutoETS | AutoETS/BottomUp | AutoETS/MinTrace_method-mint_shrink | AutoETS/MinTrace_method-ols |

Check warning on line 212 in hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx#L212

Did you really mean 'unique_id'?

Check warning on line 212 in hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx#L212

Did you really mean 'ds'?
|----|----|----|----|----|----|----|
| 0 | Australia | 2016-01-01 | 25990.068004 | 24381.911737 | 25428.089783 | 25894.399067 |
| 1 | Australia | 2016-04-01 | 24458.490282 | 22903.895964 | 23914.271400 | 24357.301898 |
Expand All @@ -225,13 +225,13 @@

We first define the temporal aggregation spec. The spec is a dictionary
in which the keys are the name of the aggregation and the value is the
amount of bottom-level timesteps that should be aggregated in that

Check warning on line 228 in hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx#L228

Did you really mean 'timesteps'?
aggregation. For example, `year` consists of `12` months, so we define a
key, value pair `"yearly":12`. We can do something similar for other
aggregations that we are interested in.

In this example, we choose a temporal aggregation of `year`,
`semiannual` and `quarter`. The bottom level timesteps have a quarterly

Check warning on line 234 in hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx#L234

Did you really mean 'timesteps'?
frequency.


Expand All @@ -240,7 +240,7 @@
```

We next compute the temporally aggregated train- and test sets using the
[`aggregate_temporal`](https://Nixtla.github.io/hierarchicalforecast/src/utils.html#aggregate_temporal)
[`aggregate_temporal`](src/utils.html#aggregate_temporal)
function. Note that we have different aggregation matrices `S` for the
train- and test set, as the test set contains temporal hierarchies that
are not included in the train set.
Expand All @@ -261,7 +261,7 @@
S_train_df_te.iloc[:5, :5]
```

| | temporal_id | quarter-1 | quarter-2 | quarter-3 | quarter-4 |

Check warning on line 264 in hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx#L264

Did you really mean 'temporal_id'?
|-----|-------------|-----------|-----------|-----------|-----------|
| 0 | year-1 | 1.0 | 1.0 | 1.0 | 1.0 |
| 1 | year-2 | 0.0 | 0.0 | 0.0 | 0.0 |
Expand All @@ -274,7 +274,7 @@
S_test_df_te.iloc[:5, :5]
```

| | temporal_id | quarter-1 | quarter-2 | quarter-3 | quarter-4 |

Check warning on line 277 in hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx#L277

Did you really mean 'temporal_id'?
|-----|--------------|-----------|-----------|-----------|-----------|
| 0 | year-1 | 1.0 | 1.0 | 1.0 | 1.0 |
| 1 | year-2 | 0.0 | 0.0 | 0.0 | 0.0 |
Expand All @@ -283,10 +283,10 @@
| 4 | semiannual-3 | 0.0 | 0.0 | 0.0 | 0.0 |

If you don’t have a test set available, as is usually the case when
you’re making forecasts, it is necessary to create a future dataframe

Check warning on line 286 in hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx#L286

Did you really mean 'dataframe'?
that holds the correct bottom-level unique_ids and timestamps so that

Check warning on line 287 in hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx#L287

Did you really mean 'unique_ids'?
they can be temporally aggregated. We can use the
[`make_future_dataframe`](https://Nixtla.github.io/hierarchicalforecast/src/utils.html#make_future_dataframe)
[`make_future_dataframe`](src/utils.html#make_future_dataframe)
helper function for that.


Expand All @@ -300,7 +300,7 @@
```

`Y_test_df_te_new` can be then used in
[`aggregate_temporal`](https://Nixtla.github.io/hierarchicalforecast/src/utils.html#aggregate_temporal)
[`aggregate_temporal`](src/utils.html#aggregate_temporal)
to construct the temporally aggregated structures:


Expand All @@ -317,7 +317,7 @@
Y_test_df_te
```

| | temporal_id | unique_id | ds | y |

Check warning on line 320 in hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx#L320

Did you really mean 'temporal_id'?

Check warning on line 320 in hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx#L320

Did you really mean 'unique_id'?

Check warning on line 320 in hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx#L320

Did you really mean 'ds'?
|----|----|----|----|----|
| 0 | year-1 | Australia | 2016-10-01 | 101484.586551 |
| 1 | year-2 | Australia | 2017-10-01 | 107709.864650 |
Expand All @@ -336,7 +336,7 @@
Y_test_df_te_new
```

| | temporal_id | unique_id | ds |

Check warning on line 339 in hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx#L339

Did you really mean 'temporal_id'?

Check warning on line 339 in hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx#L339

Did you really mean 'unique_id'?

Check warning on line 339 in hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx#L339

Did you really mean 'ds'?
|------|-------------|--------------------------------------|------------|
| 0 | year-1 | Australia | 2016-10-01 |
| 1 | year-2 | Australia | 2017-10-01 |
Expand Down Expand Up @@ -395,14 +395,14 @@
### 3c. Reconcile forecasts

We can again use the
[`HierarchicalReconciliation`](https://Nixtla.github.io/hierarchicalforecast/src/core.html#hierarchicalreconciliation)
[`HierarchicalReconciliation`](src/core.html#hierarchicalreconciliation)
class to reconcile the forecasts. In this example we use
[`BottomUp`](https://Nixtla.github.io/hierarchicalforecast/src/methods.html#bottomup)
[`BottomUp`](src/methods.html#bottomup)
and
[`MinTrace`](https://Nixtla.github.io/hierarchicalforecast/src/methods.html#mintrace).
[`MinTrace`](src/methods.html#mintrace).
Note that we have to set `temporal=True` in the `reconcile` function.

Note that temporal reconcilation currently isn’t supported for insample

Check warning on line 405 in hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx#L405

Did you really mean 'reconcilation'?

Check warning on line 405 in hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx#L405

Did you really mean 'insample'?
reconciliation methods, such as `MinTrace(method='mint_shrink')`.


Expand All @@ -418,7 +418,7 @@
## 4. Evaluation

The `HierarchicalForecast` package includes the
[`evaluate`](https://Nixtla.github.io/hierarchicalforecast/src/evaluation.html#evaluate)
[`evaluate`](src/evaluation.html#evaluate)
function to evaluate the different hierarchies.


Expand Down Expand Up @@ -457,12 +457,12 @@

| | level | metric | Base | BottomUp | MinTrace(ols) |
|-----|---------|--------|---------|----------|---------------|
| 0 | Total | rmse | 4249.25 | 4461.95 | 4234.55 |

Check warning on line 460 in hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx#L460

Did you really mean 'rmse'?
| 1 | Purpose | rmse | 1222.57 | 1273.48 | 1137.57 |

Check warning on line 461 in hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx#L461

Did you really mean 'rmse'?
| 2 | State | rmse | 635.78 | 546.02 | 611.32 |

Check warning on line 462 in hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx#L462

Did you really mean 'rmse'?
| 3 | Regions | rmse | 103.67 | 107.00 | 99.23 |

Check warning on line 463 in hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx#L463

Did you really mean 'rmse'?
| 4 | Bottom | rmse | 33.15 | 33.98 | 32.30 |

Check warning on line 464 in hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx#L464

Did you really mean 'rmse'?
| 5 | Overall | rmse | 81.89 | 82.41 | 78.97 |

Check warning on line 465 in hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx#L465

Did you really mean 'rmse'?

As can be seen `MinTrace(ols)` seems to be the best forecasting method
across each cross-sectional aggregation.
Expand Down Expand Up @@ -491,9 +491,9 @@

| | level | metric | Base | BottomUp | MinTrace(ols) |
|-----|------------|--------|--------|----------|---------------|
| 0 | year | rmse | 480.85 | 581.18 | 515.32 |

Check warning on line 494 in hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx#L494

Did you really mean 'rmse'?
| 1 | semiannual | rmse | 312.33 | 304.98 | 275.30 |

Check warning on line 495 in hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx#L495

Did you really mean 'rmse'?
| 2 | quarter | rmse | 168.02 | 168.02 | 155.61 |

Check warning on line 496 in hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx#L496

Did you really mean 'rmse'?
| 3 | Overall | rmse | 253.94 | 266.17 | 241.19 |

Again, `MinTrace(ols)` is the best overall method, scoring the lowest
Expand All @@ -505,7 +505,7 @@
Finally, we evaluate cross-temporally. To do so, we first need to obtain
the combination of cross-sectional and temporal hierarchies, for which
we can use the
[`get_cross_temporal_tags`](https://Nixtla.github.io/hierarchicalforecast/src/utils.html#get_cross_temporal_tags)
[`get_cross_temporal_tags`](src/utils.html#get_cross_temporal_tags)
helper function.


Expand Down Expand Up @@ -534,7 +534,7 @@

We now have our dataset and cross-temporal tags ready for evaluation.

We define a set of eval_tags, and now we split each cross-sectional

Check warning on line 537 in hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx#L537

Did you really mean 'eval_tags'?
aggregation also by each temporal aggregation. Note that we skip the
semiannual temporal aggregation in the below overview.

Expand Down Expand Up @@ -566,13 +566,13 @@

| | level | metric | Base | BottomUp | MinTrace(ols) |
|-----|------------------|--------|---------|----------|---------------|
| 0 | TotalByYear | rmse | 7148.99 | 8243.06 | 7748.40 |

Check warning on line 569 in hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx#L569

Did you really mean 'rmse'?
| 1 | RegionsByYear | rmse | 151.96 | 175.69 | 158.48 |

Check warning on line 570 in hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx#L570

Did you really mean 'rmse'?
| 2 | BottomByYear | rmse | 46.98 | 50.78 | 46.72 |

Check warning on line 571 in hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx#L571

Did you really mean 'rmse'?
| 3 | TotalByQuarter | rmse | 2060.77 | 2060.77 | 1942.32 |

Check warning on line 572 in hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx#L572

Did you really mean 'rmse'?
| 4 | RegionsByQuarter | rmse | 57.07 | 57.07 | 54.12 |

Check warning on line 573 in hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx#L573

Did you really mean 'rmse'?
| 5 | BottomByQuarter | rmse | 19.42 | 19.42 | 18.69 |

Check warning on line 574 in hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx#L574

Did you really mean 'rmse'?
| 6 | Overall | rmse | 43.14 | 45.27 | 42.49 |

Check warning on line 575 in hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismcrosstemporal.html.mdx#L575

Did you really mean 'rmse'?

We find that the best method is the cross-temporally reconciled method
`AutoETS/MinTrace_method-ols`, which achieves overall lowest RMSE.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Examples include the presence of geographic levels, products, or
categories that define different types of aggregations. In such
scenarios, forecasters are often required to provide predictions for all
disaggregate and aggregate series. A natural desire is for those

Check warning on line 12 in hierarchicalforecast/examples/australiandomestictourismtemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismtemporal.html.mdx#L12

Did you really mean 'disaggregate'?
predictions to be **“coherent”**, that is, for the bottom series to add
up precisely to the forecasts of the aggregated series.

Expand All @@ -20,11 +20,11 @@
each state of Australia.

We will first load the `Tourism` data and produce base forecasts using
an `AutoETS` model from `StatsForecast`. Then, we reconciliate the

Check warning on line 23 in hierarchicalforecast/examples/australiandomestictourismtemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismtemporal.html.mdx#L23

Did you really mean 'reconciliate'?
forecasts with several reconciliation algorithms from
`HierarchicalForecast` according to a temporal hierarchy.

You can run these experiments using CPU or GPU with Google Colab.

Check warning on line 27 in hierarchicalforecast/examples/australiandomestictourismtemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismtemporal.html.mdx#L27

Did you really mean 'Colab'?

<a href="https://colab.research.google.com/github/Nixtla/hierarchicalforecast/blob/main/nbs/examples/AustralianDomesticTourismTemporal.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>

Expand Down Expand Up @@ -59,7 +59,7 @@
Y_df.head()
```

| | Country | Region | State | Purpose | ds | y |

Check warning on line 62 in hierarchicalforecast/examples/australiandomestictourismtemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismtemporal.html.mdx#L62

Did you really mean 'ds'?
|-----|-----------|----------|-----------------|----------|------------|------------|
| 0 | Australia | Adelaide | South Australia | Business | 1998-01-01 | 135.077690 |
| 1 | Australia | Adelaide | South Australia | Business | 1998-04-01 | 109.987316 |
Expand Down Expand Up @@ -96,13 +96,13 @@

We first define the temporal aggregation spec. The spec is a dictionary
in which the keys are the name of the aggregation and the value is the
amount of bottom-level timesteps that should be aggregated in that

Check warning on line 99 in hierarchicalforecast/examples/australiandomestictourismtemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismtemporal.html.mdx#L99

Did you really mean 'timesteps'?
aggregation. For example, `year` consists of `12` months, so we define a
key, value pair `"yearly":12`. We can do something similar for other
aggregations that we are interested in.

In this example, we choose a temporal aggregation of `year`,
`semiannual` and `quarter`. The bottom level timesteps have a quarterly

Check warning on line 105 in hierarchicalforecast/examples/australiandomestictourismtemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismtemporal.html.mdx#L105

Did you really mean 'timesteps'?
frequency.


Expand All @@ -111,7 +111,7 @@
```

We next compute the temporally aggregated train- and test sets using the
[`aggregate_temporal`](https://Nixtla.github.io/hierarchicalforecast/src/utils.html#aggregate_temporal)
[`aggregate_temporal`](src/utils.html#aggregate_temporal)
function. Note that we have different aggregation matrices `S` for the
train- and test set, as the test set contains temporal hierarchies that
are not included in the train set.
Expand Down Expand Up @@ -175,7 +175,7 @@
S_train_df.iloc[:5, :5]
```

| | temporal_id | quarter-1 | quarter-2 | quarter-3 | quarter-4 |

Check warning on line 178 in hierarchicalforecast/examples/australiandomestictourismtemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismtemporal.html.mdx#L178

Did you really mean 'temporal_id'?
|-----|-------------|-----------|-----------|-----------|-----------|
| 0 | year-1 | 1.0 | 1.0 | 1.0 | 1.0 |
| 1 | year-2 | 0.0 | 0.0 | 0.0 | 0.0 |
Expand All @@ -188,7 +188,7 @@
S_test_df.iloc[:5, :5]
```

| | temporal_id | quarter-1 | quarter-2 | quarter-3 | quarter-4 |

Check warning on line 191 in hierarchicalforecast/examples/australiandomestictourismtemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismtemporal.html.mdx#L191

Did you really mean 'temporal_id'?
|-----|--------------|-----------|-----------|-----------|-----------|
| 0 | year-1 | 1.0 | 1.0 | 1.0 | 1.0 |
| 1 | year-2 | 0.0 | 0.0 | 0.0 | 0.0 |
Expand All @@ -197,10 +197,10 @@
| 4 | semiannual-3 | 0.0 | 0.0 | 0.0 | 0.0 |

If you don’t have a test set available, as is usually the case when
you’re making forecasts, it is necessary to create a future dataframe

Check warning on line 200 in hierarchicalforecast/examples/australiandomestictourismtemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismtemporal.html.mdx#L200

Did you really mean 'dataframe'?
that holds the correct bottom-level unique_ids and timestamps so that

Check warning on line 201 in hierarchicalforecast/examples/australiandomestictourismtemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismtemporal.html.mdx#L201

Did you really mean 'unique_ids'?
they can be temporally aggregated. We can use the
[`make_future_dataframe`](https://Nixtla.github.io/hierarchicalforecast/src/utils.html#make_future_dataframe)
[`make_future_dataframe`](src/utils.html#make_future_dataframe)
helper function for that.


Expand All @@ -214,7 +214,7 @@
```

`Y_test_df_new` can be then used in
[`aggregate_temporal`](https://Nixtla.github.io/hierarchicalforecast/src/utils.html#aggregate_temporal)
[`aggregate_temporal`](src/utils.html#aggregate_temporal)
to construct the temporally aggregated structures:


Expand All @@ -230,7 +230,7 @@
S_test_df_new
```

| | temporal_id | quarter-1 | quarter-2 | quarter-3 | quarter-4 | quarter-5 | quarter-6 | quarter-7 | quarter-8 |

Check warning on line 233 in hierarchicalforecast/examples/australiandomestictourismtemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismtemporal.html.mdx#L233

Did you really mean 'temporal_id'?
|----|----|----|----|----|----|----|----|----|----|
| 0 | year-1 | 1.0 | 1.0 | 1.0 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 |
| 1 | year-2 | 0.0 | 0.0 | 0.0 | 0.0 | 1.0 | 1.0 | 1.0 | 1.0 |
Expand All @@ -252,7 +252,7 @@
Y_test_df
```

| | temporal_id | unique_id | ds | y |

Check warning on line 255 in hierarchicalforecast/examples/australiandomestictourismtemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismtemporal.html.mdx#L255

Did you really mean 'temporal_id'?

Check warning on line 255 in hierarchicalforecast/examples/australiandomestictourismtemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismtemporal.html.mdx#L255

Did you really mean 'unique_id'?

Check warning on line 255 in hierarchicalforecast/examples/australiandomestictourismtemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismtemporal.html.mdx#L255

Did you really mean 'ds'?
|----|----|----|----|----|
| 0 | year-1 | Australia/ACT/Canberra/Business | 2016-10-01 | 754.139245 |
| 1 | year-2 | Australia/ACT/Canberra/Business | 2017-10-01 | 809.950839 |
Expand All @@ -271,7 +271,7 @@
Y_test_df_new
```

| | temporal_id | unique_id | ds |

Check warning on line 274 in hierarchicalforecast/examples/australiandomestictourismtemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismtemporal.html.mdx#L274

Did you really mean 'temporal_id'?

Check warning on line 274 in hierarchicalforecast/examples/australiandomestictourismtemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismtemporal.html.mdx#L274

Did you really mean 'unique_id'?

Check warning on line 274 in hierarchicalforecast/examples/australiandomestictourismtemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismtemporal.html.mdx#L274

Did you really mean 'ds'?
|----|----|----|----|
| 0 | year-1 | Australia/ACT/Canberra/Business | 2016-10-01 |
| 1 | year-2 | Australia/ACT/Canberra/Business | 2017-10-01 |
Expand Down Expand Up @@ -336,14 +336,14 @@
### 3c. Reconcile forecasts

We can use the
[`HierarchicalReconciliation`](https://Nixtla.github.io/hierarchicalforecast/src/core.html#hierarchicalreconciliation)
[`HierarchicalReconciliation`](src/core.html#hierarchicalreconciliation)
class to reconcile the forecasts. In this example we use
[`BottomUp`](https://Nixtla.github.io/hierarchicalforecast/src/methods.html#bottomup)
[`BottomUp`](src/methods.html#bottomup)
and
[`MinTrace`](https://Nixtla.github.io/hierarchicalforecast/src/methods.html#mintrace).
[`MinTrace`](src/methods.html#mintrace).
Note that we have to set `temporal=True` in the `reconcile` function.

Note that temporal reconcilation currently isn’t supported for insample

Check warning on line 346 in hierarchicalforecast/examples/australiandomestictourismtemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismtemporal.html.mdx#L346

Did you really mean 'reconcilation'?

Check warning on line 346 in hierarchicalforecast/examples/australiandomestictourismtemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismtemporal.html.mdx#L346

Did you really mean 'insample'?
reconciliation methods, such as `MinTrace(method='mint_shrink')`.


Expand All @@ -369,7 +369,7 @@
## 4. Evaluation

The `HierarchicalForecast` package includes the
[`evaluate`](https://Nixtla.github.io/hierarchicalforecast/src/evaluation.html#evaluate)
[`evaluate`](src/evaluation.html#evaluate)
function to evaluate the different hierarchies.

We evaluate the temporally aggregated forecasts *across all temporal
Expand Down Expand Up @@ -401,14 +401,14 @@

| | level | metric | Base | BottomUp | MinTrace(ols) |
|-----|------------|-------------|---------|----------|---------------|
| 0 | year | mae | 47.0000 | 50.8000 | 46.7000 |

Check warning on line 404 in hierarchicalforecast/examples/australiandomestictourismtemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismtemporal.html.mdx#L404

Did you really mean 'mae'?
| 1 | year | scaled_crps | 0.0562 | 0.0620 | 0.0666 |

Check warning on line 405 in hierarchicalforecast/examples/australiandomestictourismtemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismtemporal.html.mdx#L405

Did you really mean 'scaled_crps'?
| 2 | semiannual | mae | 29.5000 | 30.5000 | 29.1000 |

Check warning on line 406 in hierarchicalforecast/examples/australiandomestictourismtemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismtemporal.html.mdx#L406

Did you really mean 'mae'?
| 3 | semiannual | scaled_crps | 0.0643 | 0.0681 | 0.0727 |

Check warning on line 407 in hierarchicalforecast/examples/australiandomestictourismtemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismtemporal.html.mdx#L407

Did you really mean 'scaled_crps'?
| 4 | quarter | mae | 19.4000 | 19.4000 | 18.7000 |

Check warning on line 408 in hierarchicalforecast/examples/australiandomestictourismtemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismtemporal.html.mdx#L408

Did you really mean 'mae'?
| 5 | quarter | scaled_crps | 0.0876 | 0.0876 | 0.0864 |

Check warning on line 409 in hierarchicalforecast/examples/australiandomestictourismtemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismtemporal.html.mdx#L409

Did you really mean 'scaled_crps'?
| 6 | Overall | mae | 26.2000 | 27.1000 | 25.7000 |

Check warning on line 410 in hierarchicalforecast/examples/australiandomestictourismtemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismtemporal.html.mdx#L410

Did you really mean 'mae'?
| 7 | Overall | scaled_crps | 0.0765 | 0.0784 | 0.0797 |

Check warning on line 411 in hierarchicalforecast/examples/australiandomestictourismtemporal.html.mdx

View check run for this annotation

Mintlify / Mintlify Validation (nixtla) - vale-spellcheck

hierarchicalforecast/examples/australiandomestictourismtemporal.html.mdx#L411

Did you really mean 'scaled_crps'?

`MinTrace(ols)` is the best overall point method, scoring the lowest
`mae` on the `year` and `semiannual` aggregated forecasts as well as the
Expand Down
Loading