Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Reconciling forecasts: the hts and thief packages

Rob J Hyndman
October 12, 2016

Reconciling forecasts: the hts and thief packages

Talk given at eRum2016, Poznań, Poland.

Rob J Hyndman

October 12, 2016
Tweet

More Decks by Rob J Hyndman

Other Decks in Research

Transcript

  1. Spectacle sales Reconciling forecasts: the hts package Hierarchical and grouped

    me series 2 Monthly UK sales data from 2000 – 2014 Provided by a large spectacle manufacturer Split by brand (26), gender (3), price range (6), materials (4). Split by region, city and stores (600) About 1 million bo om-level series
  2. Hierarchical me series A hierarchical me series is a collec

    on of several me series that are linked together in a hierarchical structure. Total A AA AB AC B BA BB BC C CA CB CC Examples Sales by region, city, store Reconciling forecasts: the hts package Hierarchical and grouped me series 3
  3. Grouped me series A grouped me series is a collec

    on of me series that can be grouped together in a number of non-hierarchical ways. Total A AX AY B BX BY Total X AX BX Y AY BY Examples Sales by brand, gender, material, stores, etc. Reconciling forecasts: the hts package Hierarchical and grouped me series 4
  4. The problem 1 How to forecast me series at all

    nodes such that the forecasts add up in the same way as the original data? 2 Can we exploit rela onships between the series to improve the forecasts? Reconciling forecasts: the hts package Hierarchical and grouped me series 5
  5. The problem 1 How to forecast me series at all

    nodes such that the forecasts add up in the same way as the original data? 2 Can we exploit rela onships between the series to improve the forecasts? Reconciling forecasts: the hts package Hierarchical and grouped me series 5
  6. The solu on 1 Forecast all series at all levels

    of aggrega on using an automa c forecas ng algorithm (e.g., ets, auto.arima, ...) 2 Reconcile the resul ng forecasts so they add up correctly using least squares op miza on (i.e., find closest reconciled forecasts to the original forecasts). 3 This is all available in the hts package in R. Reconciling forecasts: the hts package Hierarchical and grouped me series 6
  7. The solu on 1 Forecast all series at all levels

    of aggrega on using an automa c forecas ng algorithm (e.g., ets, auto.arima, ...) 2 Reconcile the resul ng forecasts so they add up correctly using least squares op miza on (i.e., find closest reconciled forecasts to the original forecasts). 3 This is all available in the hts package in R. Reconciling forecasts: the hts package Hierarchical and grouped me series 6
  8. The solu on 1 Forecast all series at all levels

    of aggrega on using an automa c forecas ng algorithm (e.g., ets, auto.arima, ...) 2 Reconcile the resul ng forecasts so they add up correctly using least squares op miza on (i.e., find closest reconciled forecasts to the original forecasts). 3 This is all available in the hts package in R. Reconciling forecasts: the hts package Hierarchical and grouped me series 6
  9. hts package for R Reconciling forecasts: the hts package hts

    package for R 7 hts: Hierarchical and Grouped Time Series Methods for analysing and forecas ng hierarchical and grouped me series Version: 5.0 Depends: R ( 3.0.2), forecast ( 5.0), SparseM, Matrix, matrixcalc Imports: parallel, u ls, methods, graphics, grDevices, stats LinkingTo: Rcpp ( 0.11.0), RcppEigen Suggests: tes hat Published: 2016-04-06 Author: Rob J Hyndman, Earo Wang, Alan Lee, Shanika Wickramasuriya Maintainer: Rob J Hyndman <Rob.Hyndman at monash.edu> BugReports: https://github.com/robjhyndman/hts/issues License: GPL ( 2)
  10. Example using R library(hts) # bts is a matrix containing

    the bottom level time series # nodes describes the hierarchical structure y <- hts(bts, nodes=list(2, c(3,2))) Reconciling forecasts: the hts package hts package for R 8
  11. Example using R library(hts) # bts is a matrix containing

    the bottom level time series # nodes describes the hierarchical structure y <- hts(bts, nodes=list(2, c(3,2))) Reconciling forecasts: the hts package hts package for R 8 Total A AX AY AZ B BX BY
  12. Example using R library(hts) # bts is a matrix containing

    the bottom level time series # nodes describes the hierarchical structure y <- hts(bts, nodes=list(2, c(3,2))) # Forecast 10-step-ahead using WLS combination method # ETS used for each series by default fc <- forecast(y, h=10) Reconciling forecasts: the hts package hts package for R 9 Total A AX AY AZ B BX BY
  13. gts func on Usage gts(y, characters) Arguments y Mul variate

    me series containing the bo om level series characters Vector of integers, or list of vectors, showing how column names indicate group structure. Example bnames <- c("VIC1F","VIC1M","VIC2F","VIC2M","VIC3F","VIC3M", "NSW1F","NSW1M","NSW2F","NSW2M","NSW3F","NSW3M") bts <- matrix(ts(rnorm(120)), ncol = 12) colnames(bts) <- bnames x <- gts(bts, characters = c(3, 1, 1)) Reconciling forecasts: the hts package hts package for R 10
  14. Australian tourism Reconciling forecasts: the hts package Applica on: Australian

    tourism 11 Hierarchy: States (7) Zones (27) Regions (82)
  15. Australian tourism Reconciling forecasts: the hts package Applica on: Australian

    tourism 11 Hierarchy: States (7) Zones (27) Regions (82) Base forecasts ETS (exponen al smoothing) models
  16. Base forecasts Reconciling forecasts: the hts package Applica on: Australian

    tourism 12 Domestic tourism forecasts: Total Year Visitor nights 1998 2000 2002 2004 2006 2008 60000 65000 70000 75000 80000 85000
  17. Base forecasts Reconciling forecasts: the hts package Applica on: Australian

    tourism 12 Domestic tourism forecasts: NSW Year Visitor nights 1998 2000 2002 2004 2006 2008 18000 22000 26000 30000
  18. Base forecasts Reconciling forecasts: the hts package Applica on: Australian

    tourism 12 Domestic tourism forecasts: VIC Year Visitor nights 1998 2000 2002 2004 2006 2008 10000 12000 14000 16000 18000
  19. Base forecasts Reconciling forecasts: the hts package Applica on: Australian

    tourism 12 Domestic tourism forecasts: Nth.Coast.NSW Year Visitor nights 1998 2000 2002 2004 2006 2008 5000 6000 7000 8000 9000
  20. Base forecasts Reconciling forecasts: the hts package Applica on: Australian

    tourism 12 Domestic tourism forecasts: Metro.QLD Year Visitor nights 1998 2000 2002 2004 2006 2008 8000 9000 11000 13000
  21. Base forecasts Reconciling forecasts: the hts package Applica on: Australian

    tourism 12 Domestic tourism forecasts: Sth.WA Year Visitor nights 1998 2000 2002 2004 2006 2008 400 600 800 1000 1200 1400
  22. Base forecasts Reconciling forecasts: the hts package Applica on: Australian

    tourism 12 Domestic tourism forecasts: X201.Melbourne Year Visitor nights 1998 2000 2002 2004 2006 2008 4000 4500 5000 5500 6000
  23. Base forecasts Reconciling forecasts: the hts package Applica on: Australian

    tourism 12 Domestic tourism forecasts: X402.Murraylands Year Visitor nights 1998 2000 2002 2004 2006 2008 0 100 200 300
  24. Base forecasts Reconciling forecasts: the hts package Applica on: Australian

    tourism 12 Domestic tourism forecasts: X809.Daly Year Visitor nights 1998 2000 2002 2004 2006 2008 0 20 40 60 80 100
  25. Forecast evalua on Reconciling forecasts: the hts package Applica on:

    Australian tourism 13 Training sets Test sets h = 1 q q q q q q q q q q q q q q q q q q q q q q q q q q time
  26. Forecast evalua on Reconciling forecasts: the hts package Applica on:

    Australian tourism 13 Training sets Test sets h = 1 q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q time
  27. Forecast evalua on Reconciling forecasts: the hts package Applica on:

    Australian tourism 13 Training sets Test sets h = 1 q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q time
  28. Forecast evalua on Reconciling forecasts: the hts package Applica on:

    Australian tourism 13 Training sets Test sets h = 1 q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q time
  29. Forecast evalua on Reconciling forecasts: the hts package Applica on:

    Australian tourism 13 Training sets Test sets h = 1 q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q time
  30. Forecast evalua on Reconciling forecasts: the hts package Applica on:

    Australian tourism 13 Training sets Test sets h = 1 q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q time
  31. Forecast evalua on Reconciling forecasts: the hts package Applica on:

    Australian tourism 13 Training sets Test sets h = 1 q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q time
  32. Forecast evalua on Reconciling forecasts: the hts package Applica on:

    Australian tourism 13 Training sets Test sets h = 1 q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q time
  33. Forecast evalua on Reconciling forecasts: the hts package Applica on:

    Australian tourism 13 Training sets Test sets h = 1 q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q time
  34. Forecast evalua on Reconciling forecasts: the hts package Applica on:

    Australian tourism 13 Training sets Test sets h = 1 q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q time
  35. Forecast evalua on Reconciling forecasts: the hts package Applica on:

    Australian tourism 13 Training sets Test sets h = 1 q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q time
  36. Forecast evalua on Reconciling forecasts: the hts package Applica on:

    Australian tourism 13 Training sets Test sets h = 1 q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q time
  37. Forecast evalua on Reconciling forecasts: the hts package Applica on:

    Australian tourism 13 Training sets Test sets h = 1 q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q time
  38. Forecast evalua on Reconciling forecasts: the hts package Applica on:

    Australian tourism 13 Training sets Test sets h = 1 q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q time
  39. Forecast evalua on Reconciling forecasts: the hts package Applica on:

    Australian tourism 13 Training sets Test sets h = 1 q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q time
  40. Forecast evalua on Reconciling forecasts: the hts package Applica on:

    Australian tourism 13 Training sets Test sets h = 1 q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q time
  41. Forecast evalua on Reconciling forecasts: the hts package Applica on:

    Australian tourism 13 Training sets Test sets h = 1 q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q time
  42. Forecast evalua on Reconciling forecasts: the hts package Applica on:

    Australian tourism 13 Training sets Test sets h = 1 q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q time
  43. Forecast evalua on Reconciling forecasts: the hts package Applica on:

    Australian tourism 13 Training sets Test sets h = 1 q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q time
  44. Forecast evalua on Reconciling forecasts: the hts package Applica on:

    Australian tourism 13 Training sets Test sets h = 1 q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q time
  45. Forecast evalua on Reconciling forecasts: the hts package Applica on:

    Australian tourism 13 Training sets Test sets h = 2 q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q time
  46. Forecast evalua on Reconciling forecasts: the hts package Applica on:

    Australian tourism 13 Training sets Test sets h = 3 q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q time
  47. Forecast evalua on Reconciling forecasts: the hts package Applica on:

    Australian tourism 13 Training sets Test sets h = 4 q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q time
  48. Forecast evalua on Reconciling forecasts: the hts package Applica on:

    Australian tourism 13 Training sets Test sets h = 5 q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q time
  49. Forecast evalua on Reconciling forecasts: the hts package Applica on:

    Australian tourism 13 Training sets Test sets h = 6 q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q time
  50. Hierarchy: states, zones, regions Forecast horizon RMSE h = 1

    h = 2 h = 3 h = 4 h = 5 h = 6 Ave Australia Base 1762.04 1770.29 1766.02 1818.82 1705.35 1721.17 1757.28 Bo om 1736.92 1742.69 1722.79 1752.74 1666.73 1687.43 1718.22 OLS 1747.60 1757.68 1751.77 1800.67 1686.00 1706.45 1741.69 WLS 1705.21 1715.87 1703.75 1729.56 1627.79 1661.24 1690.57 GLS 1704.64 1715.60 1705.31 1729.04 1626.36 1661.64 1690.43 States Base 399.77 404.16 401.92 407.26 395.38 401.17 401.61 Bo om 404.29 406.95 404.96 409.02 399.80 401.55 404.43 OLS 404.47 407.62 405.43 413.79 401.10 404.90 406.22 WLS 398.84 402.12 400.71 405.03 394.76 398.23 399.95 GLS 398.84 402.16 400.86 405.03 394.59 398.22 399.95 Regions Base 93.15 93.38 93.45 93.79 93.50 93.56 93.47 Bo om 93.15 93.38 93.45 93.79 93.50 93.56 93.47 OLS 93.28 93.53 93.64 94.17 93.78 93.88 93.71 WLS 93.02 93.32 93.38 93.72 93.39 93.53 93.39 GLS 92.98 93.27 93.34 93.66 93.34 93.46 93.34 Reconciling forecasts: the hts package Applica on: Australian tourism 14
  51. Temporal hierarchies Annual Semi-Annual1 Q1 Q2 Semi-Annual2 Q3 Q4 Basic

    idea: ¯ Forecast series at each available frequency. ¯ Op mally reconcile forecasts within the same year. Reconciling forecasts: the hts package Temporal hierarchies 15
  52. Temporal hierarchies Annual Semi-Annual1 Q1 Q2 Semi-Annual2 Q3 Q4 Basic

    idea: ¯ Forecast series at each available frequency. ¯ Op mally reconcile forecasts within the same year. Reconciling forecasts: the hts package Temporal hierarchies 15
  53. Monthly series Annual Semi-Annual1 Q1 M1 M2 M3 Q2 M4

    M5 M6 Semi-Annual2 Q3 M7 M8 M9 Q4 M10 M11 M12 k = 2, 4, 12 nodes k = 3, 6, 12 nodes Why not k = 2, 3, 4, 6, 12 nodes? Reconciling forecasts: the hts package Temporal hierarchies 16
  54. Monthly series Annual FourM1 BiM1 M1 M2 BiM2 M3 M4

    FourM2 BiM3 M5 M6 BiM4 M7 M8 FourM3 BiM5 M9 M10 BiM6 M11 M12 k = 2, 4, 12 nodes k = 3, 6, 12 nodes Why not k = 2, 3, 4, 6, 12 nodes? Reconciling forecasts: the hts package Temporal hierarchies 16
  55. Monthly series Annual FourM1 BiM1 M1 M2 BiM2 M3 M4

    FourM2 BiM3 M5 M6 BiM4 M7 M8 FourM3 BiM5 M9 M10 BiM6 M11 M12 k = 2, 4, 12 nodes k = 3, 6, 12 nodes Why not k = 2, 3, 4, 6, 12 nodes? Reconciling forecasts: the hts package Temporal hierarchies 16
  56. thief package for R thief: Temporal HIErarchical Forecas ng Usage

    thief(y) thief(y, m = frequency(y), h = m*2, comb = c("struc","mse","ols","bu","shr","sam"), usemodel = c("ets","arima","theta","naive","snaive"), forecastfunction = NULL, ...) Reconciling forecasts: the hts package Temporal hierarchies 17
  57. More informa on Rob J Hyndman, Roman A Ahmed, George

    Athanasopoulos, and Han Lin Shang (2011). “Op mal combina on forecasts for hierarchical me series”. Computa onal Sta s cs & Data Analysis 55(9), 2579–2589. Rob J Hyndman, Alan J Lee, and Earo Wang (2016). “Fast computa on of reconciled forecasts for hierarchical and grouped me series”. Computa onal Sta s cs & Data Analysis 97, 16–32. Shanika L Wickramasuriya, George Athanasopoulos, and Rob J Hyndman (2015). Forecas ng hierarchical and grouped me series through trace minimiza on. Working paper 15/15. Monash University George Athanasopoulos, Rob J Hyndman, Nikolaos Kourentzes, and Fo os Petropoulos (2015). Forecas ng with temporal hierarchies. Working paper. Monash University Rob J Hyndman, Alan J Lee, Earo Wang, and Shanika Wickramasuriya (2016). hts: Hierarchical and Grouped Time Series. R package v5.0 on CRAN. Rob J Hyndman and Nikolaos Kourentzes (2016). thief: Temporal Hierarchical Forecas ng. R package v0.2 on CRAN. Reconciling forecasts: the hts package More informa on 18
  58. More informa on Rob J Hyndman, Roman A Ahmed, George

    Athanasopoulos, and Han Lin Shang (2011). “Op mal combina on forecasts for hierarchical me series”. Computa onal Sta s cs & Data Analysis 55(9), 2579–2589. Rob J Hyndman, Alan J Lee, and Earo Wang (2016). “Fast computa on of reconciled forecasts for hierarchical and grouped me series”. Computa onal Sta s cs & Data Analysis 97, 16–32. Shanika L Wickramasuriya, George Athanasopoulos, and Rob J Hyndman (2015). Forecas ng hierarchical and grouped me series through trace minimiza on. Working paper 15/15. Monash University George Athanasopoulos, Rob J Hyndman, Nikolaos Kourentzes, and Fo os Petropoulos (2015). Forecas ng with temporal hierarchies. Working paper. Monash University Rob J Hyndman, Alan J Lee, Earo Wang, and Shanika Wickramasuriya (2016). hts: Hierarchical and Grouped Time Series. R package v5.0 on CRAN. Rob J Hyndman and Nikolaos Kourentzes (2016). thief: Temporal Hierarchical Forecas ng. R package v0.2 on CRAN. Reconciling forecasts: the hts package More informa on 18 ¯ More informa on: robjhyndman.com