(with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads ›...

61
Total A AA AB AC B BA BB BC C CA CB CC 1 George Athanasopoulos (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos) Forecasting hierarchical (and grouped) time series

Transcript of (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads ›...

Page 1: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

Total

A

AA AB AC

B

BA BB BC

C

CA CB CC

1

George Athanasopoulos(with Rob J. Hyndman, Nikos Kourentzes andFotis Petropoulos)

Forecasting hierarchical (andgrouped) time series

Page 2: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

Outline

1 Hierarchical and grouped time series

2 Optimal forecasts

3 Approximately optimal forecasts

4 Temporal hierarchies

5 References

Forecasting hierarchical (and grouped) time series Hierarchical and grouped time series 2

Page 3: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

Summary

3 key developments:

1 We generalise the forecasting process in"properly" accounting for grouped data.(Empirical Application 1).

2 We advance the “optimal combination”approach by proposing two new estimatorsbased on WLS.Both now implemented in the hts package.

3 We introduce temporal hierarchies.(Empirical Application 2).

Forecasting hierarchical (and grouped) time series Hierarchical and grouped time series 3

Page 4: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

Summary

3 key developments:

1 We generalise the forecasting process in"properly" accounting for grouped data.(Empirical Application 1).

2 We advance the “optimal combination”approach by proposing two new estimatorsbased on WLS.Both now implemented in the hts package.

3 We introduce temporal hierarchies.(Empirical Application 2).

Forecasting hierarchical (and grouped) time series Hierarchical and grouped time series 3

Page 5: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

Summary

3 key developments:

1 We generalise the forecasting process in"properly" accounting for grouped data.(Empirical Application 1).

2 We advance the “optimal combination”approach by proposing two new estimatorsbased on WLS.Both now implemented in the hts package.

3 We introduce temporal hierarchies.(Empirical Application 2).

Forecasting hierarchical (and grouped) time series Hierarchical and grouped time series 3

Page 6: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

Summary

3 key developments:

1 We generalise the forecasting process in"properly" accounting for grouped data.(Empirical Application 1).

2 We advance the “optimal combination”approach by proposing two new estimatorsbased on WLS.Both now implemented in the hts package.

3 We introduce temporal hierarchies.(Empirical Application 2).

Forecasting hierarchical (and grouped) time series Hierarchical and grouped time series 3

Page 7: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

Hierarchical versus grouped

Table: Geographical Hierarchy

Level Total series per levelAustralia 1States and Territories 7

VIC, NSW, QLD, SA, WA, NT, TAS;

Zones 27VIC (5): Metro, West Coast, East Coast, Nth East, Nth West;

NSW (6): Metro, Nth Coast, Sth Coast, Sth, Nth, ACT;

QLD (4): Metro, Central Coast, Nth Coast, Inland;

Regions 76Metro VIC: Melbourne, Peninsula, Geelong;

Metro NSW: Sydney, Illawarra, Central Coast;

Metro QLD: Brisbane, Gold Coast, Sunshine Coast;

Forecasting hierarchical (and grouped) time series Hierarchical and grouped time series 4

Page 8: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

Australian domestic tourism

Forecasting hierarchical (and grouped) time series Hierarchical and grouped time series 5

Hierarchical:Australia (1)

States (7)

Zones (27)

Regions (76)

Total: 111 series

Page 9: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

Australian domestic tourism

Forecasting hierarchical (and grouped) time series Hierarchical and grouped time series 5

Purpose of travel (PoT):Holiday

Visiting Friends and Relatives

Business

Other

Page 10: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

Australian domestic tourism

Forecasting hierarchical (and grouped) time series Hierarchical and grouped time series 5

Hierarchical:Australia (1)

States (7)

Zones (27)

Regions (76)

Total: 111 series

PoT (×4):AustraliaPoT (4)

StatesPoT (28)

ZonesPoT (108)

RegionsPoT (304)

Total: 444 series

Page 11: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

Australian domestic tourism

Forecasting hierarchical (and grouped) time series Hierarchical and grouped time series 5

Hierarchical:Australia (1)

States (7)

Zones (27)

Regions (76)

Total: 111 series

PoT (×4):AustraliaPoT (4)

StatesPoT (28)

ZonesPoT (108)

RegionsPoT (304)

Total: 444 series

GroupedGrand total: 555 series

Page 12: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

Forecasting such structures

Existing methods:

ã Bottom-up

ã Top-down

ã Middle-out

Key idea: forecast reconciliationå Ignore structural constraints and forecast

every series of interest independently.

å Adjust forecasts to impose constraints.

Forecasting hierarchical (and grouped) time series Hierarchical and grouped time series 6

Page 13: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

Forecasting such structures

Existing methods:

ã Bottom-up

ã Top-down

ã Middle-out

Key idea: forecast reconciliationå Ignore structural constraints and forecast

every series of interest independently.

å Adjust forecasts to impose constraints.

Forecasting hierarchical (and grouped) time series Hierarchical and grouped time series 6

Page 14: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

Hierarchical data

Total

A B C

Forecasting hierarchical (and grouped) time series Hierarchical and grouped time series 7

Yt : observed aggregate of allseries at time t.

YX,t : observation on series X attime t.

Bt : vector of all series atbottom level in time t.

Page 15: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

Hierarchical data

Total

A B C

Forecasting hierarchical (and grouped) time series Hierarchical and grouped time series 7

Yt : observed aggregate of allseries at time t.

YX,t : observation on series X attime t.

Bt : vector of all series atbottom level in time t.

Page 16: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

Hierarchical data

Total

A B C

Yt =

YtYA,tYB,tYC,t

Forecasting hierarchical (and grouped) time series Hierarchical and grouped time series 7

Yt : observed aggregate of allseries at time t.

YX,t : observation on series X attime t.

Bt : vector of all series atbottom level in time t.

Page 17: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

Hierarchical data

Total

A B C

Yt =

YtYA,tYB,tYC,t

=

1 1 11 0 00 1 00 0 1

︸ ︷︷ ︸

S

YA,tYB,tYC,t

Forecasting hierarchical (and grouped) time series Hierarchical and grouped time series 7

Yt : observed aggregate of allseries at time t.

YX,t : observation on series X attime t.

Bt : vector of all series atbottom level in time t.

Page 18: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

Hierarchical data

Total

A B C

Yt =

YtYA,tYB,tYC,t

=

1 1 11 0 00 1 00 0 1

︸ ︷︷ ︸

S

YA,tYB,tYC,t

︸ ︷︷ ︸

Bt

Forecasting hierarchical (and grouped) time series Hierarchical and grouped time series 7

Yt : observed aggregate of allseries at time t.

YX,t : observation on series X attime t.

Bt : vector of all series atbottom level in time t.

Page 19: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

Hierarchical data

Total

A B C

Yt =

YtYA,tYB,tYC,t

=

1 1 11 0 00 1 00 0 1

︸ ︷︷ ︸

S

YA,tYB,tYC,t

︸ ︷︷ ︸

BtYt = SBt

Forecasting hierarchical (and grouped) time series Hierarchical and grouped time series 7

Yt : observed aggregate of allseries at time t.

YX,t : observation on series X attime t.

Bt : vector of all series atbottom level in time t.

Page 20: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

Hierarchical dataTotal

A

AX AY AZ

B

BX BY

C

CX CY

Yt =

YtYA,tYB,tYC,tYAX,tYAY,tYAZ,tYBX,tYBY,tYCX,tYCY,t

=

1 1 1 1 1 1 11 1 1 0 0 0 00 0 0 1 1 0 00 0 0 0 0 1 11 0 0 0 0 0 00 1 0 0 0 0 00 0 1 0 0 0 00 0 0 1 0 0 00 0 0 0 1 0 00 0 0 0 0 1 00 0 0 0 0 0 1

︸ ︷︷ ︸

S

YAX,tYAY,tYAZ,tYBX,tYBY,tYCX,tYCY,t

︸ ︷︷ ︸

Bt

Forecasting hierarchical (and grouped) time series Hierarchical and grouped time series 8

Page 21: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

Hierarchical dataTotal

A

AX AY AZ

B

BX BY

C

CX CY

Yt =

YtYA,tYB,tYC,tYAX,tYAY,tYAZ,tYBX,tYBY,tYCX,tYCY,t

=

1 1 1 1 1 1 11 1 1 0 0 0 00 0 0 1 1 0 00 0 0 0 0 1 11 0 0 0 0 0 00 1 0 0 0 0 00 0 1 0 0 0 00 0 0 1 0 0 00 0 0 0 1 0 00 0 0 0 0 1 00 0 0 0 0 0 1

︸ ︷︷ ︸

S

YAX,tYAY,tYAZ,tYBX,tYBY,tYCX,tYCY,t

︸ ︷︷ ︸

Bt

Forecasting hierarchical (and grouped) time series Hierarchical and grouped time series 8

Page 22: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

Hierarchical dataTotal

A

AX AY AZ

B

BX BY

C

CX CY

Yt =

YtYA,tYB,tYC,tYAX,tYAY,tYAZ,tYBX,tYBY,tYCX,tYCY,t

=

1 1 1 1 1 1 11 1 1 0 0 0 00 0 0 1 1 0 00 0 0 0 0 1 11 0 0 0 0 0 00 1 0 0 0 0 00 0 1 0 0 0 00 0 0 1 0 0 00 0 0 0 1 0 00 0 0 0 0 1 00 0 0 0 0 0 1

︸ ︷︷ ︸

S

YAX,tYAY,tYAZ,tYBX,tYBY,tYCX,tYCY,t

︸ ︷︷ ︸

Bt

Forecasting hierarchical (and grouped) time series Hierarchical and grouped time series 8

Yt = SBt

Page 23: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

Grouped dataTotal

A

AX AY

B

BX BY

Total

X

AX BX

Y

AY BY

Yt =

YtYA,tYB,tYX,tYY,tYAX,tYAY,tYBX,tYBY,t

=

1 1 1 11 1 0 00 0 1 11 0 1 00 1 0 11 0 0 00 1 0 00 0 1 00 0 0 1

︸ ︷︷ ︸

S

YAX,tYAY,tYBX,tYBY,t

︸ ︷︷ ︸

Bt

Forecasting hierarchical (and grouped) time series Hierarchical and grouped time series 9

Page 24: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

Grouped dataTotal

A

AX AY

B

BX BY

Total

X

AX BX

Y

AY BY

Yt =

YtYA,tYB,tYX,tYY,tYAX,tYAY,tYBX,tYBY,t

=

1 1 1 11 1 0 00 0 1 11 0 1 00 1 0 11 0 0 00 1 0 00 0 1 00 0 0 1

︸ ︷︷ ︸

S

YAX,tYAY,tYBX,tYBY,t

︸ ︷︷ ︸

Bt

Forecasting hierarchical (and grouped) time series Hierarchical and grouped time series 9

Page 25: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

Grouped dataTotal

A

AX AY

B

BX BY

Total

X

AX BX

Y

AY BY

Yt =

YtYA,tYB,tYX,tYY,tYAX,tYAY,tYBX,tYBY,t

=

1 1 1 11 1 0 00 0 1 11 0 1 00 1 0 11 0 0 00 1 0 00 0 1 00 0 0 1

︸ ︷︷ ︸

S

YAX,tYAY,tYBX,tYBY,t

︸ ︷︷ ︸

Bt

Forecasting hierarchical (and grouped) time series Hierarchical and grouped time series 9

Yt = SBt

Page 26: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

Outline

1 Hierarchical and grouped time series

2 Optimal forecasts

3 Approximately optimal forecasts

4 Temporal hierarchies

5 References

Forecasting hierarchical (and grouped) time series Optimal forecasts 10

Page 27: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

Optimal forecasts

Key idea: forecast reconciliationå Ignore structural constraints and forecast

every series of interest independently.

å Adjust forecasts to impose constraints.

Let Yn(h) be vector of initial h-step forecasts,made at time n, stacked in same order as Yt.

Yt = SBt . So Yn(h) = Sβn(h) + εh .

βn(h) = E[Bn+h | Y1, . . . ,Yn].εh has zero mean and covariance Σh.Estimate βn(h) using GLS?

Forecasting hierarchical (and grouped) time series Optimal forecasts 11

Page 28: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

Optimal forecasts

Key idea: forecast reconciliationå Ignore structural constraints and forecast

every series of interest independently.

å Adjust forecasts to impose constraints.

Let Yn(h) be vector of initial h-step forecasts,made at time n, stacked in same order as Yt.

Yt = SBt . So Yn(h) = Sβn(h) + εh .

βn(h) = E[Bn+h | Y1, . . . ,Yn].εh has zero mean and covariance Σh.Estimate βn(h) using GLS?

Forecasting hierarchical (and grouped) time series Optimal forecasts 11

Page 29: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

Optimal forecasts

Key idea: forecast reconciliationå Ignore structural constraints and forecast

every series of interest independently.

å Adjust forecasts to impose constraints.

Let Yn(h) be vector of initial h-step forecasts,made at time n, stacked in same order as Yt.

Yt = SBt . So Yn(h) = Sβn(h) + εh .

βn(h) = E[Bn+h | Y1, . . . ,Yn].εh has zero mean and covariance Σh.Estimate βn(h) using GLS?

Forecasting hierarchical (and grouped) time series Optimal forecasts 11

Page 30: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

Optimal forecasts

Key idea: forecast reconciliationå Ignore structural constraints and forecast

every series of interest independently.

å Adjust forecasts to impose constraints.

Let Yn(h) be vector of initial h-step forecasts,made at time n, stacked in same order as Yt.

Yt = SBt . So Yn(h) = Sβn(h) + εh .

βn(h) = E[Bn+h | Y1, . . . ,Yn].εh has zero mean and covariance Σh.Estimate βn(h) using GLS?

Forecasting hierarchical (and grouped) time series Optimal forecasts 11

Page 31: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

Optimal forecasts

Key idea: forecast reconciliationå Ignore structural constraints and forecast

every series of interest independently.

å Adjust forecasts to impose constraints.

Let Yn(h) be vector of initial h-step forecasts,made at time n, stacked in same order as Yt.

Yt = SBt . So Yn(h) = Sβn(h) + εh .

βn(h) = E[Bn+h | Y1, . . . ,Yn].εh has zero mean and covariance Σh.Estimate βn(h) using GLS?

Forecasting hierarchical (and grouped) time series Optimal forecasts 11

Page 32: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

Optimal forecasts

Key idea: forecast reconciliationå Ignore structural constraints and forecast

every series of interest independently.

å Adjust forecasts to impose constraints.

Let Yn(h) be vector of initial h-step forecasts,made at time n, stacked in same order as Yt.

Yt = SBt . So Yn(h) = Sβn(h) + εh .

βn(h) = E[Bn+h | Y1, . . . ,Yn].εh has zero mean and covariance Σh.Estimate βn(h) using GLS?

Forecasting hierarchical (and grouped) time series Optimal forecasts 11

Page 33: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

Optimal combination forecasts

Yn(h) = Sβn(h) = S(S′Σ†hS)−1S′Σ†hYn(h)

Optimal P = (S′Σ†hS)−1S′Σ†h.

Σ†h is generalized inverse of Σh.

Revised forecasts unbiased: SPS = S.

Revised forecasts minimum variance:

Var[Yn(h)|Y1, . . . ,Yn] = S(S′Σ†hS)−1S′.

Problem: Σh hard to estimate.Forecasting hierarchical (and grouped) time series Optimal forecasts 12

Page 34: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

Optimal combination forecasts

Yn(h) = Sβn(h) = S(S′Σ†hS)−1S′Σ†hYn(h)

Initial forecasts

Optimal P = (S′Σ†hS)−1S′Σ†h.

Σ†h is generalized inverse of Σh.

Revised forecasts unbiased: SPS = S.

Revised forecasts minimum variance:

Var[Yn(h)|Y1, . . . ,Yn] = S(S′Σ†hS)−1S′.

Problem: Σh hard to estimate.Forecasting hierarchical (and grouped) time series Optimal forecasts 12

Page 35: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

Optimal combination forecasts

Yn(h) = Sβn(h) = S(S′Σ†hS)−1S′Σ†hYn(h)

Initial forecasts

Optimal P = (S′Σ†hS)−1S′Σ†h.

Σ†h is generalized inverse of Σh.

Revised forecasts unbiased: SPS = S.

Revised forecasts minimum variance:

Var[Yn(h)|Y1, . . . ,Yn] = S(S′Σ†hS)−1S′.

Problem: Σh hard to estimate.Forecasting hierarchical (and grouped) time series Optimal forecasts 12

Page 36: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

Optimal combination forecasts

Yn(h) = Sβn(h) = S(S′Σ†hS)−1S′Σ†hYn(h)

Revised forecasts Initial forecasts

Optimal P = (S′Σ†hS)−1S′Σ†h.

Σ†h is generalized inverse of Σh.

Revised forecasts unbiased: SPS = S.

Revised forecasts minimum variance:

Var[Yn(h)|Y1, . . . ,Yn] = S(S′Σ†hS)−1S′.

Problem: Σh hard to estimate.Forecasting hierarchical (and grouped) time series Optimal forecasts 12

Page 37: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

Optimal combination forecasts

Yn(h) = Sβn(h) = S(S′Σ†hS)−1S′Σ†hYn(h)

Revised forecasts Initial forecasts

Optimal P = (S′Σ†hS)−1S′Σ†h.

Σ†h is generalized inverse of Σh.

Revised forecasts unbiased: SPS = S.

Revised forecasts minimum variance:

Var[Yn(h)|Y1, . . . ,Yn] = S(S′Σ†hS)−1S′.

Problem: Σh hard to estimate.Forecasting hierarchical (and grouped) time series Optimal forecasts 12

Page 38: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

Optimal combination forecasts

Yn(h) = Sβn(h) = S(S′Σ†hS)−1S′Σ†hYn(h)

Revised forecasts Initial forecasts

Optimal P = (S′Σ†hS)−1S′Σ†h.

Σ†h is generalized inverse of Σh.

Revised forecasts unbiased: SPS = S.

Revised forecasts minimum variance:

Var[Yn(h)|Y1, . . . ,Yn] = S(S′Σ†hS)−1S′.

Problem: Σh hard to estimate.Forecasting hierarchical (and grouped) time series Optimal forecasts 12

Page 39: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

Optimal combination forecasts

Yn(h) = Sβn(h) = S(S′Σ†hS)−1S′Σ†hYn(h)

Revised forecasts Initial forecasts

Optimal P = (S′Σ†hS)−1S′Σ†h.

Σ†h is generalized inverse of Σh.

Revised forecasts unbiased: SPS = S.

Revised forecasts minimum variance:

Var[Yn(h)|Y1, . . . ,Yn] = S(S′Σ†hS)−1S′.

Problem: Σh hard to estimate.Forecasting hierarchical (and grouped) time series Optimal forecasts 12

Page 40: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

Optimal combination forecasts

Yn(h) = Sβn(h) = S(S′Σ†hS)−1S′Σ†hYn(h)

Revised forecasts Initial forecasts

Optimal P = (S′Σ†hS)−1S′Σ†h.

Σ†h is generalized inverse of Σh.

Revised forecasts unbiased: SPS = S.

Revised forecasts minimum variance:

Var[Yn(h)|Y1, . . . ,Yn] = S(S′Σ†hS)−1S′.

Problem: Σh hard to estimate.Forecasting hierarchical (and grouped) time series Optimal forecasts 12

Page 41: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

Outline

1 Hierarchical and grouped time series

2 Optimal forecasts

3 Approximately optimal forecasts

4 Temporal hierarchies

5 References

Forecasting hierarchical (and grouped) time series Approximately optimal forecasts 13

Page 42: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

Approx. optimal forecasts

Forecasting hierarchical (and grouped) time series Approximately optimal forecasts 14

Yn(h) = S(S′Σ†hS)−1S′Σ†hYn(h)

Solution 1: OLSAssume εh ≈ SεB,h where εB,h is the forecasterror at bottom level.

If Moore-Penrose generalized inverse used,then (S′Σ†S)−1S′Σ† = (S′S)−1S′.

Yn(h) = S(S′S)−1S′Yn(h)

Page 43: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

Approx. optimal forecasts

Forecasting hierarchical (and grouped) time series Approximately optimal forecasts 15

Yn(h) = S(S′Σ†hS)−1S′Σ†hYn(h)

Solution 2: RescalingSuppose we approximate Σh by its diagonal.

Let Λ =[diagonal

(Σ1

)]−1contain inverse

one-step ahead in-sample forecast errorvariances.

Yn(h) = S(S′ΛS)−1S′ΛYn(h)

Page 44: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

Approx. optimal forecasts

Forecasting hierarchical (and grouped) time series Approximately optimal forecasts 16

Yn(h) = S(S′ΛS)−1S′ΛYn(h)

Solution 3: AveragingIf the bottom level error series areapproximately uncorrelated and have similarvariances, then Λ is inversely proportional tothe number of series contributing to eachnode.

So set Λ to be the inverse row sums of S:

Λ = diag(S× 1)−1

where 1 = (1,1, . . . ,1)′.

Page 45: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

Outline

1 Hierarchical and grouped time series

2 Optimal forecasts

3 Approximately optimal forecasts

4 Temporal hierarchies

5 References

Forecasting hierarchical (and grouped) time series Temporal hierarchies 17

Page 46: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

Temporal hierarchies: quarterly

Annual

Semi-Anual1

Q1 Q2

Semi-Anual2

Q3 Q4

Basic idea:å Forecast series at each available

frequency.

å Optimally combine forecasts within thesame year.

Forecasting hierarchical (and grouped) time series Temporal hierarchies 18

Page 47: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

Temporal hierarchies: quarterly

Annual

Semi-Anual1

Q1 Q2

Semi-Anual2

Q3 Q4

Basic idea:å Forecast series at each available

frequency.

å Optimally combine forecasts within thesame year.

Forecasting hierarchical (and grouped) time series Temporal hierarchies 18

Page 48: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

Temporal hierarchies: monthly

Annual

Semi-Anual1

Q1

M1 M2 M3

Q2

M4 M5 M6

Semi-Anual2

Q3

M7 M8 M9

Q4

M10 M11 M12

Aggregate: 3, 6, 12Alternatively: 2, 4, 12.How about: 2, 3, 4, 6, 12?

Forecasting hierarchical (and grouped) time series Temporal hierarchies 19

Page 49: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

Temporal hierarchies: monthly

Annual

FourM1

BiM1

M1 M2

BiM2

M3 M4

FourM2

BiM3

M5 M6

BiM4

M7 M8

FourM3

BiM5

M9 M10

BiM6

M11 M12

Aggregate: 3, 6, 12Alternatively: 2, 4, 12.How about: 2, 3, 4, 6, 12?

Forecasting hierarchical (and grouped) time series Temporal hierarchies 19

Page 50: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

Temporal hierarchies: monthly

Annual

FourM1

BiM1

M1 M2

BiM2

M3 M4

FourM2

BiM3

M5 M6

BiM4

M7 M8

FourM3

BiM5

M9 M10

BiM6

M11 M12

Aggregate: 3, 6, 12Alternatively: 2, 4, 12.How about: 2, 3, 4, 6, 12?

Forecasting hierarchical (and grouped) time series Temporal hierarchies 19

Page 51: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

Monthly data

ASemiA1

SemiA2

FourM1

FourM2

FourM3

Q1

...Q4

BiM1

...BiM6

M1

...M12

︸ ︷︷ ︸

(28×1)

=

1 1 1 1 1 1 1 1 1 1 1 11 1 1 1 1 1 0 0 0 0 0 00 0 0 0 0 0 1 1 1 1 1 11 1 1 1 0 0 0 0 0 0 0 00 0 0 0 1 1 1 1 0 0 0 00 0 0 0 0 0 0 0 1 1 1 11 1 1 0 0 0 0 0 0 0 0 0

...0 0 0 0 0 0 0 0 0 1 1 11 1 0 0 0 0 0 0 0 0 0 0

...0 0 0 0 0 0 0 0 0 0 1 1

I12

︸ ︷︷ ︸

S

M1

M2

M3

M4

M5

M6

M7

M8

M9

M10

M11

M12

︸ ︷︷ ︸

Bt

Forecasting hierarchical (and grouped) time series Temporal hierarchies 20

Page 52: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

Experimental setup:

M3 forecasting competition (Makridakisand Hibon, 2000, IJF). In total 3003 series.

1,428 monthly series with a test sample of12 observations each.

756 quarterly series with a test sample of8 observations each.

Forecast each series with ETS (ARIMA)models. Methods performed well in theactual competition.

Forecasting hierarchical (and grouped) time series Temporal hierarchies 21

Page 53: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

Experimental setup:

M3 forecasting competition (Makridakisand Hibon, 2000, IJF). In total 3003 series.

1,428 monthly series with a test sample of12 observations each.

756 quarterly series with a test sample of8 observations each.

Forecast each series with ETS (ARIMA)models. Methods performed well in theactual competition.

Forecasting hierarchical (and grouped) time series Temporal hierarchies 21

Page 54: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

Experimental setup:

M3 forecasting competition (Makridakisand Hibon, 2000, IJF). In total 3003 series.

1,428 monthly series with a test sample of12 observations each.

756 quarterly series with a test sample of8 observations each.

Forecast each series with ETS (ARIMA)models. Methods performed well in theactual competition.

Forecasting hierarchical (and grouped) time series Temporal hierarchies 21

Page 55: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

Experimental setup:

M3 forecasting competition (Makridakisand Hibon, 2000, IJF). In total 3003 series.

1,428 monthly series with a test sample of12 observations each.

756 quarterly series with a test sample of8 observations each.

Forecast each series with ETS (ARIMA)models. Methods performed well in theactual competition.

Forecasting hierarchical (and grouped) time series Temporal hierarchies 21

Page 56: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

Results: Monthly

Forecast Horizon (h)sMAPE Annual SemiA FourM Q BiM M Average(obs) (1) (2) (3) (4) (6) (12)

ETS

Initial 9.66 9.18 9.76 10.14 10.82 12.85 10.40

Bottom-up 8.38 9.14 9.78 10.06 11.04 12.85 10.21

OLS 7.80 8.64 9.39 9.72 10.68 12.68 9.82Scaling 7.64 8.44 9.15 9.49 10.45 12.40 9.60Averaging 7.51 8.31 9.05 9.38 10.34 12.30 9.48

Forecasting hierarchical (and grouped) time series Temporal hierarchies 22

Page 57: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

Results: Quarterly

Forecast Horizon (h)sMAPE Annual Semi-Ann Quart Average(obs) (2) (4) (8)

ETS

Initial 10.50 9.97 9.84 10.10

Bottom-up 8.87 9.35 9.84 9.35

OLS 9.31 9.78 10.28 9.79Scaling 8.75 9.19 9.70 9.21Averaging 8.81 9.26 9.78 9.28

Forecasting hierarchical (and grouped) time series Temporal hierarchies 23

Page 58: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

Outline

1 Hierarchical and grouped time series

2 Optimal forecasts

3 Approximately optimal forecasts

4 Temporal hierarchies

5 References

Forecasting hierarchical (and grouped) time series References 24

Page 59: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

More information

Forecasting hierarchical (and grouped) time series References 25

Vignette on CRAN

Page 60: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

References

RJ Hyndman, RA Ahmed, G Athanasopoulos, and HL

Shang (2011). “Optimal combination forecasts for

hierarchical time series”. Computational Statistics and

Data Analysis 55(9), 2579-2589.

G Athanasopoulos, RA Ahmed, RJ Hyndman,(2009).

“Hierarchical forecasts for Australian domestic tourism”.

International Journal of Forecasting 25, 146-166.

RJ Hyndman, et al., (2014). hts: Hierarchical time series.

cran.r-project.org/package=hts.

RJ Hyndman and G Athanasopoulos (2014). Forecasting:

principles and practice. OTexts. www.otexts.org/fpp/.

Forecasting hierarchical (and grouped) time series References 26

Page 61: (with Rob J. Hyndman, Nikos Kourentzes and Fotis Petropoulos ... › wp-content › uploads › gravity_forms › 7-2a51… · Fotis Petropoulos) Forecasting hierarchical (and grouped)

References

RJ Hyndman, RA Ahmed, G Athanasopoulos, and HL

Shang (2011). “Optimal combination forecasts for

hierarchical time series”. Computational Statistics and

Data Analysis 55(9), 2579-2589.

G Athanasopoulos, RA Ahmed, RJ Hyndman,(2009).

“Hierarchical forecasts for Australian domestic tourism”.

International Journal of Forecasting 25, 146-166.

RJ Hyndman, et al., (2014). hts: Hierarchical time series.

cran.r-project.org/package=hts.

RJ Hyndman and G Athanasopoulos (2014). Forecasting:

principles and practice. OTexts. www.otexts.org/fpp/.

Forecasting hierarchical (and grouped) time series References 26

å Email:

[email protected]

Acknowledgments: Rob J Hyndman, Roman

Ahmed, Han Shang, Shanika Wickramasuriya,

Nikolaos Kourentzes, Fotios Petropoulos.

Acknowledgments: Excellent research

assistance by Earo Wang.