Hierarchical and Grouped Time Series

Author

Arvind Sharma

Published

November 9, 2025

1 Introduction

In many real-world applications, time-series data are organized in structured forms—for example, products within categories, stores within regions, or states within a country. When these series are related through aggregation, they are referred to as Hierarchical or Grouped time series.

These structures arise naturally in:

  • Retail forecasting (products, stores, regions)
  • Tourism demand (states, purposes, demographics)
  • Supply chain management (warehouses, distribution centers)
  • Economic data (national, regional, sectoral aggregates)

Understanding the difference between hierarchical and grouped structures is crucial for forecast reconciliation and maintaining consistency across aggregation levels.


2 Hierarchical Time Series (HTS)

2.1 Definition

A hierarchical time series is organized in a tree-like structure, where observations at higher levels are obtained by summing the series at lower levels.

Key characteristics:

  • Each parent node in the hierarchy is the aggregate of its child nodes
  • Aggregation flows along a single path, typically from the bottom (most detailed level) to the top (overall total)
  • Forms a strict tree structure with no cross-classification

2.2 Example: Retail Sales Hierarchy

Consider a retail company tracking sales across a geographic hierarchy:

Total (Country)
 ├── State A
 │    ├── Region A1
 │    │    ├── Store A1a
 │    │    └── Store A1b
 │    └── Region A2
 │         ├── Store A2a
 │         └── Store A2b
 └── State B
      ├── Region B1
      │    └── Store B1a
      └── Region B2
           └── Store B2a

Here, store-level sales sum to region-level totals, region-level totals sum to state totals, and state totals sum to the national level.

2.3 Mathematical Representation

Let \(y_t\) denote the total series at time \(t\), and let \(\mathbf{b}_t\) denote the vector of bottom-level series. The hierarchical structure can be expressed using a summing matrix \(\mathbf{S}\):

\[ \mathbf{y}_t = \mathbf{S} \mathbf{b}_t \]

where \(\mathbf{y}_t\) contains all series in the hierarchy (from top to bottom), and \(\mathbf{S}\) defines the aggregation structure.

2.3.1 Example with 3 bottom-level series

Suppose we have three stores (A, B, C) in two regions:

  • Region 1: Stores A, B
  • Region 2: Store C
  • Total: All stores

The summing matrix is:

\[ \mathbf{S} = \begin{bmatrix} 1 & 1 & 1 \\ 1 & 1 & 0 \\ 0 & 0 & 1 \\ 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix} \]

The series vector is:

\[ \mathbf{y}_t = \begin{bmatrix} \text{Total} \\ \text{Region 1} \\ \text{Region 2} \\ \text{Store A} \\ \text{Store B} \\ \text{Store C} \end{bmatrix} = \mathbf{S} \begin{bmatrix} y_{A,t} \\ y_{B,t} \\ y_{C,t} \end{bmatrix} \]


3 Grouped Time Series (GTS)

3.1 Definition

A grouped time series does not follow a single hierarchical tree. Instead, the same observations can be aggregated along multiple independent dimensions—for example, region, product type, or customer segment.

Key characteristics:

  • Each dimension provides a different aggregation view of the same base data
  • The structure allows cross-classification, meaning a single observation may belong to several groups simultaneously
  • Multiple valid aggregation paths exist

3.2 Example: Tourism Data

A tourism company tracks visitor numbers by both state and purpose of travel:

State Purpose Visitors
NSW Business 1,200
NSW Leisure 3,400
VIC Business 800
VIC Leisure 2,100

This dataset has two aggregation dimensions:

  1. By State: NSW, VIC (geographical aggregation)
  2. By Purpose: Business, Leisure (functional aggregation)

Because these dimensions intersect, the same dataset can be summarized in multiple ways:

  • State totals: NSW total, VIC total
  • Purpose totals: Business total, Leisure total
  • Grand total: All visitors

3.3 Grouped Structure Visualization

                    Total
                   /     \
                  /       \
            By State     By Purpose
            /     \       /        \
          NSW    VIC   Business  Leisure
         /  \    / \
    NSW×Bus NSW×Leis VIC×Bus VIC×Leis

Note that the bottom level (NSW×Business, NSW×Leisure, etc.) is the same in both aggregation paths, but the intermediate levels differ.

3.4 Mathematical Representation

Similar to HTS, we can express a grouped time series using a summing matrix:

\[ \mathbf{y}_t = \mathbf{S} \mathbf{b}_t \]

However, \(\mathbf{S}\) now contains multiple aggregation paths corresponding to different grouping variables.

3.4.1 Example: Two-way Grouping

For the tourism example with 2 states × 2 purposes = 4 bottom-level series:

\[ \mathbf{y}_t = \begin{bmatrix} \text{Total} \\ \text{NSW} \\ \text{VIC} \\ \text{Business} \\ \text{Leisure} \\ \text{NSW×Business} \\ \text{NSW×Leisure} \\ \text{VIC×Business} \\ \text{VIC×Leisure} \end{bmatrix} = \mathbf{S} \begin{bmatrix} y_{\text{NSW×Bus},t} \\ y_{\text{NSW×Leis},t} \\ y_{\text{VIC×Bus},t} \\ y_{\text{VIC×Leis},t} \end{bmatrix} \]

The summing matrix is:

\[ \mathbf{S} = \begin{bmatrix} 1 & 1 & 1 & 1 \\ 1 & 1 & 0 & 0 \\ 0 & 0 & 1 & 1 \\ 1 & 0 & 1 & 0 \\ 0 & 1 & 0 & 1 \\ 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix} \]


4 Comparing HTS and GTS

Feature Hierarchical Time Series (HTS) Grouped Time Series (GTS)
Structure Tree-like (one aggregation path) Cross-classified (multiple paths)
Aggregation Rule Each upper level = sum of disaggregated levels Data can be aggregated along several dimensions
Example Country → State → City State × Purpose (two-way grouping)
Reconciliation Straightforward, follows hierarchy More complex, must reconcile across multiple views
Use Case Forecasts that roll up cleanly through levels Forecasts that can be sliced by different dimensions
Flexibility Single view of aggregation Multiple simultaneous views
Important

You are not asking a different research question when you model as GTS vs HTS. You are asking the same economic question (e.g., forecasting tourism demand), but you are telling the software how the data are organized and should be reconciled.

That structure determines:

  • how forecasts aggregate or cross-classify,

  • which reconciliation methods are valid, and

  • how is_aggregated() will recognize levels for plotting or filtering.

You are defining what belongs to what, not yet what to forecast.

The model itself (ETS, ARIMA, etc.) doesn’t “know” whether it’s HTS or GTS — it’s the reconciliation step that uses the structure.

5 Forecast Reconciliation

5.1 The Challenge

When forecasting hierarchical or grouped time series, forecasts made at different levels may be incoherent—that is, the forecasts at upper levels may not equal the sum of forecasts at lower levels.

Example of incoherence:

  • Forecast for Total = 1,000 units
  • Forecast for State A = 600 units
  • Forecast for State B = 500 units
  • Problem: 600 + 500 = 1,100 ≠ 1,000

5.2 Reconciliation Methods

Reconciliation adjusts forecasts to ensure internal consistency across all levels of the hierarchy or grouping structure.

5.2.1 Common Approaches

  1. Bottom-up: Forecast only at the bottom level, then aggregate

    • Pros: Simple, respects detailed patterns
    • Cons: Bottom-level forecasts may be noisy
  2. Top-down: Forecast at the top level, then disaggregate using proportions

    • Pros: Stable aggregate forecast
    • Cons: May lose detailed information
  3. Middle-out: Forecast at an intermediate level, then aggregate up and disaggregate down

  4. Optimal reconciliation (MinT): Use all forecasts and find optimal combination that minimizes forecast error variance

    • Most sophisticated approach
    • Requires estimating forecast error covariance matrix
Caution

These four methodsbottom-up, top-down, middle-out, and MinT — are reconciliation methods, not forecasting models.

Forecasting models, on the other hand, are statistical or machine learning models used to produce base forecasts for each series before reconciliation like ETS, ARIMA, TSLM, Neural network, etc. Each of these models produces unreconciled (independent) forecasts.

Step Type Examples Purpose
Base Models Forecasting models ETS(), ARIMA(), TSLM() Generate initial forecasts for each series.
Reconciliation Adjustment methods bottom_up(), top_down(), middle_out(), min_trace() Enforce coherence across the structure.

5.3 Optimal Reconciliation Formula

Let \(\tilde{\mathbf{y}}_{h}\) denote the base forecasts (possibly incoherent) for all levels. The reconciled forecasts are:

\[ \hat{\mathbf{y}}_{h} = \mathbf{S} \mathbf{G} \tilde{\mathbf{y}}_{h} \]

where \(\mathbf{G}\) is a matrix chosen to minimize forecast error variance subject to the constraint that \(\mathbf{S}\mathbf{G}\mathbf{S} = \mathbf{S}\) (aggregating reconciled forecasts at the bottom level equals the reconciled forecasts at higher levels).

  • S enforces aggregation structure.

  • G defines how adjustments propagate to ensure coherence.

Note

All reconciliation methods (BU, TD, MO, MinT) apply to both HTS and GTS.
- The underlying math (via the summing matrix (S)) is the same.
- HTS: simpler tree structure.
- GTS: multiple crossing dimensions → larger (S), more complex reconciliation.


6 Practical Considerations

6.1 When to Use HTS vs GTS

Use Hierarchical Time Series when:

  • Data has a natural tree structure (geography, products)
  • Single aggregation dimension is sufficient
  • Simpler reconciliation is desired

Use Grouped Time Series when:

  • Multiple independent categorizations exist
  • Cross-tabulations are meaningful
  • Flexibility in aggregation views is needed

6.2 Software Implementation

Both HTS and GTS can be handled in R using the fable and fabletools packages:

6.2.1 Australian domestic overnight trips: Structure (State / Region) * Purpose

A dataset containing the quarterly overnight trips from 1998 Q1 to 2016 Q4 across Australia.

A tsibble with 23,408 rows and 5 variables:

  • Quarter: Year quarter (index)

  • Region: The tourism regions are formed through the aggregation of Statistical Local Areas (SLAs) which are defined by the various State and Territory tourism authorities according to their research and marketing needs

  • State: States and territories of Australia

  • Purpose: Stopover purpose of visit:

    • “Holiday”

    • “Visiting friends and relatives”

    • “Business”

    • “Other reason”

  • Trips: Overnight trips in thousands

In a tsibble (tidy time series), each observation is uniquely identified by:

  • A time index → e.g. Quarter

  • A key → one or more variables that define individual series

We can see that there are 5 total columns, with 4 character vectors and only 1 numeric variable. We can examine the variable names in multiple ways -

We can see from attr(*, "key")=tsibble[304x4] that there are 304 unique time series in the tsibble, each defined by the key that is a combination of Region + State + Purpose.

remove(list = ls())

library(fable)
Loading required package: fabletools
Registered S3 method overwritten by 'tsibble':
  method               from 
  as_tibble.grouped_df dplyr
library(fabletools)
library(tsibble)

Attaching package: 'tsibble'
The following objects are masked from 'package:base':

    intersect, setdiff, union
library(skimr)
library(dplyr)

Attaching package: 'dplyr'
The following objects are masked from 'package:stats':

    filter, lag
The following objects are masked from 'package:base':

    intersect, setdiff, setequal, union
library(ggplot2)


# Explore structure - (State / Region) * Purpose
?tourism
##skim(tsibble::tourism)
#str(tsibble::tourism)
head(tourism)
# A tsibble: 6 x 5 [1Q]
# Key:       Region, State, Purpose [1]
  Quarter Region   State           Purpose  Trips
    <qtr> <chr>    <chr>           <chr>    <dbl>
1 1998 Q1 Adelaide South Australia Business  135.
2 1998 Q2 Adelaide South Australia Business  110.
3 1998 Q3 Adelaide South Australia Business  166.
4 1998 Q4 Adelaide South Australia Business  127.
5 1999 Q1 Adelaide South Australia Business  137.
6 1999 Q2 Adelaide South Australia Business  200.

6.3 Understanding the key

Confirm the key.

key_vars(tourism)
[1] "Region"  "State"   "Purpose"
index_var(tourism)
[1] "Quarter"
# more brute force
tsibble::tourism %>%
  distinct(Region, State, Purpose) %>%
  count()
# A tibble: 1 × 1
      n
  <int>
1   304
table(tourism$State)

               ACT    New South Wales Northern Territory         Queensland 
               320               4160               2240               3840 
   South Australia           Tasmania           Victoria  Western Australia 
              3840               1600               6720               1600 
table(tourism$Region)

                       Adelaide                  Adelaide Hills 
                            320                             320 
                  Alice Springs         Australia's Coral Coast 
                            320                             320 
     Australia's Golden Outback          Australia's North West 
                            320                             320 
         Australia's South West                        Ballarat 
                            320                             320 
                         Barkly                         Barossa 
                            320                             320 
                 Bendigo Loddon                  Blue Mountains 
                            320                             320 
                       Brisbane                       Bundaberg 
                            320                             320 
                       Canberra                 Capital Country 
                            320                             320 
                  Central Coast               Central Highlands 
                            320                             320 
                 Central Murray                     Central NSW 
                            320                             320 
             Central Queensland                    Clare Valley 
                            320                             320 
                  Darling Downs                          Darwin 
                            320                             320 
                     East Coast                Experience Perth 
                            320                             320 
                 Eyre Peninsula              Fleurieu Peninsula 
                            320                             320 
    Flinders Ranges and Outback                    Fraser Coast 
                            320                             320 
      Geelong and the Bellarine                       Gippsland 
                            320                             320 
                     Gold Coast                        Goulburn 
                            320                             320 
               Great Ocean Road                    High Country 
                            320                             320 
           Hobart and the South                          Hunter 
                            320                             320 
                  Kakadu Arnhem                 Kangaroo Island 
                            320                             320 
                 Katherine Daly                           Lakes 
                            320                             320 
                       Lasseter Launceston, Tamar and the North 
                            320                             320 
                Limestone Coast                      MacDonnell 
                            320                             320 
                        Macedon                          Mackay 
                            320                             320 
                         Mallee                       Melbourne 
                            320                             320 
                 Melbourne East                     Murray East 
                            320                             320 
                    Murraylands          New England North West 
                            320                             320 
                North Coast NSW                      North West 
                            320                             320 
                       Northern                         Outback 
                            320                             320 
                    Outback NSW                       Peninsula 
                            320                             320 
                 Phillip Island                        Riverina 
                            320                             320 
                      Riverland                 Snowy Mountains 
                            320                             320 
                    South Coast                     Spa Country 
                            320                             320 
                 Sunshine Coast                          Sydney 
                            320                             320 
                     The Murray       Tropical North Queensland 
                            320                             320 
                    Upper Yarra               Western Grampians 
                            320                             320 
                    Whitsundays                 Wilderness West 
                            320                             320 
                        Wimmera                 Yorke Peninsula 
                            320                             320 
table(tourism$Region, tourism$State)
                                 
                                  ACT New South Wales Northern Territory
  Adelaide                          0               0                  0
  Adelaide Hills                    0               0                  0
  Alice Springs                     0               0                320
  Australia's Coral Coast           0               0                  0
  Australia's Golden Outback        0               0                  0
  Australia's North West            0               0                  0
  Australia's South West            0               0                  0
  Ballarat                          0               0                  0
  Barkly                            0               0                320
  Barossa                           0               0                  0
  Bendigo Loddon                    0               0                  0
  Blue Mountains                    0             320                  0
  Brisbane                          0               0                  0
  Bundaberg                         0               0                  0
  Canberra                        320               0                  0
  Capital Country                   0             320                  0
  Central Coast                     0             320                  0
  Central Highlands                 0               0                  0
  Central Murray                    0               0                  0
  Central NSW                       0             320                  0
  Central Queensland                0               0                  0
  Clare Valley                      0               0                  0
  Darling Downs                     0               0                  0
  Darwin                            0               0                320
  East Coast                        0               0                  0
  Experience Perth                  0               0                  0
  Eyre Peninsula                    0               0                  0
  Fleurieu Peninsula                0               0                  0
  Flinders Ranges and Outback       0               0                  0
  Fraser Coast                      0               0                  0
  Geelong and the Bellarine         0               0                  0
  Gippsland                         0               0                  0
  Gold Coast                        0               0                  0
  Goulburn                          0               0                  0
  Great Ocean Road                  0               0                  0
  High Country                      0               0                  0
  Hobart and the South              0               0                  0
  Hunter                            0             320                  0
  Kakadu Arnhem                     0               0                320
  Kangaroo Island                   0               0                  0
  Katherine Daly                    0               0                320
  Lakes                             0               0                  0
  Lasseter                          0               0                320
  Launceston, Tamar and the North   0               0                  0
  Limestone Coast                   0               0                  0
  MacDonnell                        0               0                320
  Macedon                           0               0                  0
  Mackay                            0               0                  0
  Mallee                            0               0                  0
  Melbourne                         0               0                  0
  Melbourne East                    0               0                  0
  Murray East                       0               0                  0
  Murraylands                       0               0                  0
  New England North West            0             320                  0
  North Coast NSW                   0             320                  0
  North West                        0               0                  0
  Northern                          0               0                  0
  Outback                           0               0                  0
  Outback NSW                       0             320                  0
  Peninsula                         0               0                  0
  Phillip Island                    0               0                  0
  Riverina                          0             320                  0
  Riverland                         0               0                  0
  Snowy Mountains                   0             320                  0
  South Coast                       0             320                  0
  Spa Country                       0               0                  0
  Sunshine Coast                    0               0                  0
  Sydney                            0             320                  0
  The Murray                        0             320                  0
  Tropical North Queensland         0               0                  0
  Upper Yarra                       0               0                  0
  Western Grampians                 0               0                  0
  Whitsundays                       0               0                  0
  Wilderness West                   0               0                  0
  Wimmera                           0               0                  0
  Yorke Peninsula                   0               0                  0
                                 
                                  Queensland South Australia Tasmania Victoria
  Adelaide                                 0             320        0        0
  Adelaide Hills                           0             320        0        0
  Alice Springs                            0               0        0        0
  Australia's Coral Coast                  0               0        0        0
  Australia's Golden Outback               0               0        0        0
  Australia's North West                   0               0        0        0
  Australia's South West                   0               0        0        0
  Ballarat                                 0               0        0      320
  Barkly                                   0               0        0        0
  Barossa                                  0             320        0        0
  Bendigo Loddon                           0               0        0      320
  Blue Mountains                           0               0        0        0
  Brisbane                               320               0        0        0
  Bundaberg                              320               0        0        0
  Canberra                                 0               0        0        0
  Capital Country                          0               0        0        0
  Central Coast                            0               0        0        0
  Central Highlands                        0               0        0      320
  Central Murray                           0               0        0      320
  Central NSW                              0               0        0        0
  Central Queensland                     320               0        0        0
  Clare Valley                             0             320        0        0
  Darling Downs                          320               0        0        0
  Darwin                                   0               0        0        0
  East Coast                               0               0      320        0
  Experience Perth                         0               0        0        0
  Eyre Peninsula                           0             320        0        0
  Fleurieu Peninsula                       0             320        0        0
  Flinders Ranges and Outback              0             320        0        0
  Fraser Coast                           320               0        0        0
  Geelong and the Bellarine                0               0        0      320
  Gippsland                                0               0        0      320
  Gold Coast                             320               0        0        0
  Goulburn                                 0               0        0      320
  Great Ocean Road                         0               0        0      320
  High Country                             0               0        0      320
  Hobart and the South                     0               0      320        0
  Hunter                                   0               0        0        0
  Kakadu Arnhem                            0               0        0        0
  Kangaroo Island                          0             320        0        0
  Katherine Daly                           0               0        0        0
  Lakes                                    0               0        0      320
  Lasseter                                 0               0        0        0
  Launceston, Tamar and the North          0               0      320        0
  Limestone Coast                          0             320        0        0
  MacDonnell                               0               0        0        0
  Macedon                                  0               0        0      320
  Mackay                                 320               0        0        0
  Mallee                                   0               0        0      320
  Melbourne                                0               0        0      320
  Melbourne East                           0               0        0      320
  Murray East                              0               0        0      320
  Murraylands                              0             320        0        0
  New England North West                   0               0        0        0
  North Coast NSW                          0               0        0        0
  North West                               0               0      320        0
  Northern                               320               0        0        0
  Outback                                320               0        0        0
  Outback NSW                              0               0        0        0
  Peninsula                                0               0        0      320
  Phillip Island                           0               0        0      320
  Riverina                                 0               0        0        0
  Riverland                                0             320        0        0
  Snowy Mountains                          0               0        0        0
  South Coast                              0               0        0        0
  Spa Country                              0               0        0      320
  Sunshine Coast                         320               0        0        0
  Sydney                                   0               0        0        0
  The Murray                               0               0        0        0
  Tropical North Queensland              320               0        0        0
  Upper Yarra                              0               0        0      320
  Western Grampians                        0               0        0      320
  Whitsundays                            320               0        0        0
  Wilderness West                          0               0      320        0
  Wimmera                                  0               0        0      320
  Yorke Peninsula                          0             320        0        0
                                 
                                  Western Australia
  Adelaide                                        0
  Adelaide Hills                                  0
  Alice Springs                                   0
  Australia's Coral Coast                       320
  Australia's Golden Outback                    320
  Australia's North West                        320
  Australia's South West                        320
  Ballarat                                        0
  Barkly                                          0
  Barossa                                         0
  Bendigo Loddon                                  0
  Blue Mountains                                  0
  Brisbane                                        0
  Bundaberg                                       0
  Canberra                                        0
  Capital Country                                 0
  Central Coast                                   0
  Central Highlands                               0
  Central Murray                                  0
  Central NSW                                     0
  Central Queensland                              0
  Clare Valley                                    0
  Darling Downs                                   0
  Darwin                                          0
  East Coast                                      0
  Experience Perth                              320
  Eyre Peninsula                                  0
  Fleurieu Peninsula                              0
  Flinders Ranges and Outback                     0
  Fraser Coast                                    0
  Geelong and the Bellarine                       0
  Gippsland                                       0
  Gold Coast                                      0
  Goulburn                                        0
  Great Ocean Road                                0
  High Country                                    0
  Hobart and the South                            0
  Hunter                                          0
  Kakadu Arnhem                                   0
  Kangaroo Island                                 0
  Katherine Daly                                  0
  Lakes                                           0
  Lasseter                                        0
  Launceston, Tamar and the North                 0
  Limestone Coast                                 0
  MacDonnell                                      0
  Macedon                                         0
  Mackay                                          0
  Mallee                                          0
  Melbourne                                       0
  Melbourne East                                  0
  Murray East                                     0
  Murraylands                                     0
  New England North West                          0
  North Coast NSW                                 0
  North West                                      0
  Northern                                        0
  Outback                                         0
  Outback NSW                                     0
  Peninsula                                       0
  Phillip Island                                  0
  Riverina                                        0
  Riverland                                       0
  Snowy Mountains                                 0
  South Coast                                     0
  Spa Country                                     0
  Sunshine Coast                                  0
  Sydney                                          0
  The Murray                                      0
  Tropical North Queensland                       0
  Upper Yarra                                     0
  Western Grampians                               0
  Whitsundays                                     0
  Wilderness West                                 0
  Wimmera                                         0
  Yorke Peninsula                                 0

6.3.1 Structure is confirmed as (State / Region) * Purpose.

Read data dictionary, eyeball/View(), use commands to confirm the data structure is HTS or GTS. Then model accordingly.

# 1. Create hierarchical and grouped structures
tourism_hts <- tourism %>%
  aggregate_key(State / Region, Trips = sum(Trips))

tourism_gts <- tourism %>%
  aggregate_key(State * Purpose, Trips = sum(Trips))

# 2. Fit models (creates a mable)
fit_gts <- tourism_gts %>%
  model(ets = ETS(Trips))

# 3. Reconcile (applied to the model table, not forecasts)
fit_reconciled <- fit_gts %>%
  reconcile(
    bu = bottom_up(ets),  # Bottom-Up: sum from bottom-level series
   # td_fp = top_down(ets, method = "forecast_proportions"), # Top-Down: split using forecast proportions
   # td_ap = top_down(ets, method = "average_proportions"),  # Top-Down: split using average proportions
    mint_shrink = min_trace(ets, method = "mint_shrink"),   # MinT Shrinkage
    mint_ols = min_trace(ets, method = "ols")               # MinT OLS
  )

# 4. Forecast from the reconciled model
fc <- fit_reconciled %>%
  forecast(h = 8)  # 8 quarters = 2 years

head(fc)
# A fable: 6 x 6 [1Q]
# Key:     State, Purpose, .model [1]
Loading required namespace: crayon
  State  Purpose  .model Quarter
  <chr*> <chr*>   <chr>    <qtr>
1 ACT    Business ets    2018 Q1
2 ACT    Business ets    2018 Q2
3 ACT    Business ets    2018 Q3
4 ACT    Business ets    2018 Q4
5 ACT    Business ets    2019 Q1
6 ACT    Business ets    2019 Q2
# ℹ 2 more variables: Trips <dist>, .mean <dbl>

6.4 Reconciliation Method Nuances

6.4.1 Bottom-Up (BU)

Use when: bottom-level data are rich and reliable.

Mechanism: \[ \hat{y}_{\text{total}} = \sum \hat{y}_{\text{bottom}} \]

Nuances:

  • Works for both hierarchical and grouped data structures
  • Always coherent (forecasts add up exactly)
  • With 2 levels (Total → State), simply sums bottom-level forecasts — identical to middle_out()
  • If bottom-level data are volatile or sparse, noise propagates upward
  • Reliable and easy to interpret baseline

6.4.2 Middle-Out (MO)

(Not available in fable package, but conceptually important.)

Use when: at least 3 hierarchical levels (e.g., Country → State → Region).

Mechanism:

  • Forecast at an intermediate level
  • Then aggregate upward and disaggregate downward

Nuances:

  • With only 2 levels, middle_out() automatically defaults to bottom-up — redundant but safe
  • Not applicable to grouped or crossed hierarchies
  • Best for deep hierarchies where middle levels are most stable

6.4.3 Top-Down (TD)

(Only works with hierarchical structures — commented out correctly in the code above.)

Use when: the data form a strict, single-tree hierarchy.

Mechanism:

Forecast at the top level, then split lower-level forecasts using:

  • method = "forecast_proportions" (dynamic)
  • method = "average_proportions" (historical average)

Nuances:

  • Works only for strictly nested hierarchies (e.g., Total / State / Region)
  • Not valid for grouped or crossed structures (e.g., Purpose * State)
  • In 2-level hierarchies, valid — splits total to subseries by proportion
  • Good when totals are stable and lower-level data are noisy
  • Throws error on grouped structures (as demonstrated earlier)

6.4.4 MinT (Minimum Trace) — OLS & Shrinkage

Use when: you want the most statistically efficient reconciliation.

Mechanism:

Minimizes total forecast variance while enforcing coherence:

\[ \tilde{y} = S G \hat{y}, \quad G = (S' \Sigma^{-1} S)^{-1} S' \Sigma^{-1} \]

where:

  • \(S\) = summing matrix (hierarchical structure)
  • \(\Sigma\) = forecast error covariance matrix

Variants:

  • method = "ols" → assumes equal forecast error variance (simpler)
  • method = "mint_shrink" → shrinkage estimator for covariance (more stable)

Nuances:

  • Works for any structure — hierarchical, grouped, or mixed
  • Statistically optimal: uses correlations between series (“borrows strength”)
  • In 2-level hierarchies, acts like a weighted hybrid between top-down and bottom-up
  • Preferred in modern forecasting applications

6.4.5 Comparison Summary

Method Works For Needs Strict Hierarchy? Behavior (2 Levels) Strength Limitation
Top-Down Hierarchical only Yes Valid (splits total) Uses stable totals Fails for grouped structures
Bottom-Up Hierarchical / Grouped No Simple summation Coherent, interpretable Propagates bottom-level noise
Middle-Out Hierarchical (3+ levels) Yes Defaults to BU Balances top & bottom Not meaningful if only 2 levels
MinT-OLS / Shrink All structures No Weighted optimum Statistically efficient Needs covariance estimation

7 Visualizing Reconciled Forecasts

After generating reconciled forecasts (fc), we visualize them to confirm:

  1. Coherence – forecasts add up correctly across hierarchy levels.
  2. Behavior – different reconciliation methods (Bottom-Up, Middle-Out, MinT) produce realistic, consistent trends.

Below we use autoplot() from fpp3 to examine forecasts at multiple levels.

# --- 1. Compare all reconciliation methods ------------------------------
autoplot(fc, tourism_gts) +
  labs(
    title = "Forecast Reconciliation Methods (8-Quarter Horizon)",
    subtitle = "Comparing Bottom-Up, MinT (OLS), and MinT (Shrinkage)",
    y = "Trips",
    x = "Year"
  ) +
  facet_wrap(~ .model, scales = "free_y") +
  theme_minimal()

# --- 2. Focus on one geographic unit (Victoria) -------------------------
fc %>%
  filter(State == "Victoria") %>%
  autoplot(tourism_gts) +
  labs(
    title = "Reconciled Forecasts for Victoria",
    subtitle = "Comparison across Bottom-Up and MinT methods",
    y = "Trips",
    x = "Year"
  ) +
  facet_wrap(~ .model) +
  theme_minimal()

# --- 3. Top-Level Aggregation: Total Tourism Trips ----------------------
fc %>%
  filter(is_aggregated(State), is_aggregated(Purpose)) %>%
  autoplot(tourism_gts) +
  labs(
    title = "Total Tourism Trips – Coherent Forecasts",
    subtitle = "Top-Level Series after Reconciliation (All States × All Purposes)",
    y = "Trips",
    x = "Year"
  ) +
  facet_wrap(~ .model) +
  theme_minimal()

# --- 4. State-Level Totals (Aggregated over Purpose) --------------------
fc %>%
  filter(!is_aggregated(State), is_aggregated(Purpose)) %>%
  autoplot(tourism_gts) +
  labs(
    title = "State-Level Total Tourism Trips (Aggregated over Purpose)",
    subtitle = "Useful for comparing geographic performance",
    y = "Trips",
    x = "Year"
  ) +
  facet_wrap(~ State) +
  theme_minimal()

# --- 5. Purpose-Level Totals (Aggregated over State) --------------------
fc %>%
  filter(is_aggregated(State), !is_aggregated(Purpose)) %>%
  autoplot(tourism_gts) +
  labs(
    title = "Purpose-Level Total Tourism Trips (Aggregated over State)",
    subtitle = "Useful for analyzing trends by travel purpose",
    y = "Trips",
    x = "Year"
  ) +
  facet_wrap(~ Purpose) +
  theme_minimal()

Plot Aggregation Level Key Insight
1 All series Compare reconciliation methods visually
2 Victoria only Assess local forecast coherence
3 Total Check top-level consistency
4 State totals Compare states geographically
5 Purpose totals Understand motivation trends
Forecasting Level (Your Choice)

Once the structure is declared and reconciled, you can forecast at any level you want — bottom, middle, or top.

For example, in HTS:

  • forecast at Region → automatically sums to State and Total.

  • forecast at State → middle-out.

  • forecast at Total → top-down.

In GTS:

  • forecast at State × Purpose → bottom-up aggregation gives totals.

  • forecast at State (aggregated over Purpose) or at Purpose (aggregated over State).

You can flexibly choose the forecast level at the end — because the structure ensures all levels remain coherent.

8 Summary

Note
  • Hierarchical Time Series (HTS): Data arranged in a single hierarchy; each level aggregates the ones below it

    • Single aggregation path
    • Tree structure
    • Simpler reconciliation
  • Grouped Time Series (GTS): Data structured across multiple, possibly intersecting hierarchies; provides multiple valid aggregation paths

    • Cross-classification
    • Multiple aggregation dimensions
    • More complex reconciliation required
  • Feature Hierarchical (HTS) Grouped (GTS)
    Structure Pure tree (one parent per series) Cross-classification (multiple valid groupings)
    Aggregation Path Unique (e.g., Country → State → Region) Multiple (e.g., State and Purpose both aggregate to Total)
    Number of constraints Simpler, fewer summation rules More complex, overlapping constraints
    Computational cost Lower Higher
    Interpretation Forecasts roll up neatly through one tree Forecasts must satisfy several simultaneous totals
  • Forecast Reconciliation: Essential for maintaining internal consistency across all aggregation views

    • Ensures forecasts add up correctly
    • Optimal methods can improve forecast accuracy at all levels

Grouped structures increase flexibility but require more sophisticated forecast reconciliation to maintain internal consistency across all aggregation views.

Reconciliation Method Selection Guide
  • Top-Down → disaggregate from stable totals (strict hierarchies only)
  • Bottom-Up → aggregate from detailed data (always safe)
  • Middle-Out → start in the middle (redundant for 2 levels)
  • MinT → optimal hybrid, handles all structures efficiently

Use Bottom-Up for simplicity, Top-Down for stable aggregates, Middle-Out for deep hierarchies, and MinT for statistical optimality.

Reconciliation methods come after modeling, and adjust forecasts so that they are coherent — meaning they add up correctly across the hierarchy or grouping.

Reconciliation Method What It Does When It’s Used
Bottom-Up Aggregates forecasts from lowest level upward When bottom-level data are reliable
Top-Down Disaggregates total forecasts down to components When aggregate data are more stable
Middle-Out Combines both: model at an intermediate level When middle level is best trade-off
MinT (Minimum Trace) Uses all levels and error covariances for optimal reconciliation When accuracy and coherence are both important

9 Further Reading

  • Hyndman, R.J., & Athanasopoulos, G. (2021). Forecasting: Principles and Practice (3rd ed.), Chapter 11: Forecasting hierarchical and grouped time series. OTexts.

  • Wickramasuriya, S.L., Athanasopoulos, G., & Hyndman, R.J. (2019). Optimal forecast reconciliation for hierarchical and grouped time series through trace minimization. Journal of the American Statistical Association, 114(526), 804-819.

  • Athanasopoulos, G., Hyndman, R.J., Kourentzes, N., & Petropoulos, F. (2017). Forecasting with temporal hierarchies. European Journal of Operational Research, 262(1), 60-74.

9.1 Step-by-step workflow

When you begin working with hierarchical or grouped time series (like the tourism data), your process looks like this:

Step Task Example Command Purpose
1 Read data dictionary read documentation or metadata Understand variables (e.g., State, Region, Purpose).
2 Eyeball / View() / glimpse() View(tourism) or glimpse(tourism) Inspect how data are organized.
3 Confirm structure type Is it State / Region (HTS) or State * Purpose (GTS)? Identify whether the data are hierarchical or grouped.
4 Build structure aggregate_key(State / Region, Trips = sum(Trips)) Define the aggregation relationships.
5 Model model(ETS(Trips)) Fit forecasting models for each series.
6 Reconcile reconcile(bu = bottom_up(...), mint = min_trace(...)) Make forecasts coherent across levels.