Forecasting using - Rob J Hyndmanrobjhyndman.com/talks/RevolutionR/12-Cross-validation.pdf · A...

download Forecasting using - Rob J Hyndmanrobjhyndman.com/talks/RevolutionR/12-Cross-validation.pdf · A more sophisticated version of training/test sets. ... Number of calls to large American

If you can't read please download the document

Transcript of Forecasting using - Rob J Hyndmanrobjhyndman.com/talks/RevolutionR/12-Cross-validation.pdf · A...

  • Forecasting using

    12. Advanced methods

    OTexts.com/fpp/2/5/

    Forecasting using R 1

    Rob J Hyndman

  • Outline

    1 Cross-validation

    2 Time series with complex seasonality

    3 Forecasting proportions

    4 Some case studies

    5 Forecasting resources

    Forecasting using R Cross-validation 2

  • Cross-validation

    Standard cross-validationA more sophisticated version of training/test sets.

    Select one observation for test set, and useremaining observations in training set.Compute error on test observation.

    Repeat using each possible observation as thetest set.

    Compute accuracy measure over all errors.

    Does not work normally for time series becausewe cannot use future observations to build amodel.

    Forecasting using R Cross-validation 3

  • Cross-validation

    Standard cross-validationA more sophisticated version of training/test sets.

    Select one observation for test set, and useremaining observations in training set.Compute error on test observation.

    Repeat using each possible observation as thetest set.

    Compute accuracy measure over all errors.

    Does not work normally for time series becausewe cannot use future observations to build amodel.

    Forecasting using R Cross-validation 3

  • Cross-validation

    Standard cross-validationA more sophisticated version of training/test sets.

    Select one observation for test set, and useremaining observations in training set.Compute error on test observation.

    Repeat using each possible observation as thetest set.

    Compute accuracy measure over all errors.

    Does not work normally for time series becausewe cannot use future observations to build amodel.

    Forecasting using R Cross-validation 3

  • Cross-validation

    Standard cross-validationA more sophisticated version of training/test sets.

    Select one observation for test set, and useremaining observations in training set.Compute error on test observation.

    Repeat using each possible observation as thetest set.

    Compute accuracy measure over all errors.

    Does not work normally for time series becausewe cannot use future observations to build amodel.

    Forecasting using R Cross-validation 3

  • Time series cross-validationAssume k is the minimum number of observationsfor a training set.

    Select observation k + i for test set, and useobservations at times 1,2, . . . , k + i 1 toestimate model. Compute error on forecast fortime k + i.

    Repeat for i = 0,1, . . . , T k where T is totalnumber of observations.

    Compute accuracy measure over all errors.

    Also called rolling forecasting origin because theorigin (k + i 1) at which forecast is based rollsforward in time.

    Forecasting using R Cross-validation 4

  • Time series cross-validationAssume k is the minimum number of observationsfor a training set.

    Select observation k + i for test set, and useobservations at times 1,2, . . . , k + i 1 toestimate model. Compute error on forecast fortime k + i.

    Repeat for i = 0,1, . . . , T k where T is totalnumber of observations.

    Compute accuracy measure over all errors.

    Also called rolling forecasting origin because theorigin (k + i 1) at which forecast is based rollsforward in time.

    Forecasting using R Cross-validation 4

  • Time series cross-validationAssume k is the minimum number of observationsfor a training set.

    Select observation k + i for test set, and useobservations at times 1,2, . . . , k + i 1 toestimate model. Compute error on forecast fortime k + i.

    Repeat for i = 0,1, . . . , T k where T is totalnumber of observations.

    Compute accuracy measure over all errors.

    Also called rolling forecasting origin because theorigin (k + i 1) at which forecast is based rollsforward in time.

    Forecasting using R Cross-validation 4

  • Time series cross-validationAssume k is the minimum number of observationsfor a training set.

    Select observation k + i for test set, and useobservations at times 1,2, . . . , k + i 1 toestimate model. Compute error on forecast fortime k + i.

    Repeat for i = 0,1, . . . , T k where T is totalnumber of observations.

    Compute accuracy measure over all errors.

    Also called rolling forecasting origin because theorigin (k + i 1) at which forecast is based rollsforward in time.

    Forecasting using R Cross-validation 4

  • Time series cross-validationAssume k is the minimum number of observationsfor a training set.

    Select observation k + i for test set, and useobservations at times 1,2, . . . , k + i 1 toestimate model. Compute error on forecast fortime k + i.

    Repeat for i = 0,1, . . . , T k where T is totalnumber of observations.

    Compute accuracy measure over all errors.

    Also called rolling forecasting origin because theorigin (k + i 1) at which forecast is based rollsforward in time.

    Forecasting using R Cross-validation 4

  • Example: Pharmaceutical sales

    Forecasting using R Cross-validation 5

    Antidiabetic drug sales

    Year

    $ m

    illio

    n

    1995 2000 2005

    510

    1520

    2530

  • Example: Pharmaceutical sales

    Forecasting using R Cross-validation 5

    Log Antidiabetic drug sales

    Year

    1995 2000 2005

    1.0

    1.5

    2.0

    2.5

    3.0

  • Example: Pharmaceutical sales

    Which of these models is best?1 Linear model with trend and seasonal dummies

    applied to log data.

    2 ARIMA model applied to log data

    3 ETS model applied to original data

    Set k = 48 as minimum training set.

    Forecast 12 steps ahead based on data to timek + i 1 for i = 1,2, . . . ,156.Compare MAE values for each forecast horizon.

    Forecasting using R Cross-validation 6

  • Example: Pharmaceutical sales

    Which of these models is best?1 Linear model with trend and seasonal dummies

    applied to log data.

    2 ARIMA model applied to log data

    3 ETS model applied to original data

    Set k = 48 as minimum training set.

    Forecast 12 steps ahead based on data to timek + i 1 for i = 1,2, . . . ,156.Compare MAE values for each forecast horizon.

    Forecasting using R Cross-validation 6

  • Example: Pharmaceutical sales

    Which of these models is best?1 Linear model with trend and seasonal dummies

    applied to log data.

    2 ARIMA model applied to log data

    3 ETS model applied to original data

    Set k = 48 as minimum training set.

    Forecast 12 steps ahead based on data to timek + i 1 for i = 1,2, . . . ,156.Compare MAE values for each forecast horizon.

    Forecasting using R Cross-validation 6

  • Example: Pharmaceutical sales

    Which of these models is best?1 Linear model with trend and seasonal dummies

    applied to log data.

    2 ARIMA model applied to log data

    3 ETS model applied to original data

    Set k = 48 as minimum training set.

    Forecast 12 steps ahead based on data to timek + i 1 for i = 1,2, . . . ,156.Compare MAE values for each forecast horizon.

    Forecasting using R Cross-validation 6

  • Example: Pharmaceutical sales

    Which of these models is best?1 Linear model with trend and seasonal dummies

    applied to log data.

    2 ARIMA model applied to log data

    3 ETS model applied to original data

    Set k = 48 as minimum training set.

    Forecast 12 steps ahead based on data to timek + i 1 for i = 1,2, . . . ,156.Compare MAE values for each forecast horizon.

    Forecasting using R Cross-validation 6

  • Example: Pharmaceutical sales

    Which of these models is best?1 Linear model with trend and seasonal dummies

    applied to log data.

    2 ARIMA model applied to log data

    3 ETS model applied to original data

    Set k = 48 as minimum training set.

    Forecast 12 steps ahead based on data to timek + i 1 for i = 1,2, . . . ,156.Compare MAE values for each forecast horizon.

    Forecasting using R Cross-validation 6

  • Example: Pharmaceutical sales

    Which of these models is best?1 Linear model with trend and seasonal dummies

    applied to log data.

    2 ARIMA model applied to log data

    3 ETS model applied to original data

    Set k = 48 as minimum training set.

    Forecast 12 steps ahead based on data to timek + i 1 for i = 1,2, . . . ,156.Compare MAE values for each forecast horizon.

    Forecasting using R Cross-validation 6

  • Example: Pharmaceutical sales

    Forecasting using R Cross-validation 7

    2 4 6 8 10 12

    9010

    011

    012

    013

    014

    0

    horizon

    MA

    E

    LMARIMAETS

  • Example: Pharmaceutical sales

    Forecasting using R Cross-validation 7

    2 4 6 8 10 12

    9095

    100

    105

    110

    115

    120

    Onestep forecasts

    horizon

    MA

    E

    LMARIMAETS

  • Example: Pharmaceutical salesk

  • Variations on time series cross validation

    Forecasting using R Cross-validation 9

    Keep training window of fixed length.xshort

  • Outline

    1 Cross-validation

    2 Time series with complex seasonality

    3 Forecasting proportions

    4 Some case studies

    5 Forecasting resources

    Forecasting using R Time series with complex seasonality 10

  • Examples

    Forecasting using R Time series with complex seasonality 11

    US finished motor gasoline products

    Weeks

    Tho

    usan

    ds o

    f bar

    rels

    per

    day

    1992 1994 1996 1998 2000 2002 2004

    6500

    7000

    7500

    8000

    8500

    9000

    9500

  • Examples

    Forecasting using R Time series with complex seasonality 11

    Number of calls to large American bank (7am9pm)

    5 minute intervals

    Num

    ber

    of c

    all a

    rriv

    als

    100

    200

    300

    400

    3 March 17 March 31 March 14 April 28 April 12 May

  • Examples

    Forecasting using R Time series with complex seasonality 11

    Turkish electricity demand

    Days

    Ele

    ctric

    ity d

    eman

    d (G

    W)

    2000 2002 2004 2006 2008

    1015

    2025

  • TBATS model

    TBATSTrigonometric terms for seasonalityBox-Cox transformations for heterogeneityARMA errors for short-term dynamicsTrend (possibly damped)Seasonal (including multiple and

    non-integer periods)

    Forecasting using R Time series with complex seasonality 12

  • TBATS model

    yt = observation at time t

    y()t =

    {(yt 1)/ if 6= 0;log yt if = 0.

    y()t = `t1 + bt1 +Mi=1

    s(i)tmi + dt

    `t = `t1 + bt1 + dt

    bt = (1 )b+ bt1 + dt

    dt =pi=1

    idti +qj=1

    jtj + t

    s(i)t =kij=1

    s(i)j,t

    Forecasting using R Time series with complex seasonality 13

    s(i)j,t = s(i)j,t1 cos

    (i)j + s

    (i)j,t1 sin

    (i)j +

    (i)1 dt

    s(i)j,t = s(i)j,t1 sin

    (i)j + s

    (i)j,t1 cos

    (i)j +

    (i)2 dt

  • TBATS model

    yt = observation at time t

    y()t =

    {(yt 1)/ if 6= 0;log yt if = 0.

    y()t = `t1 + bt1 +Mi=1

    s(i)tmi + dt

    `t = `t1 + bt1 + dt

    bt = (1 )b+ bt1 + dt

    dt =pi=1

    idti +qj=1

    jtj + t

    s(i)t =kij=1

    s(i)j,t

    Forecasting using R Time series with complex seasonality 13

    s(i)j,t = s(i)j,t1 cos

    (i)j + s

    (i)j,t1 sin

    (i)j +

    (i)1 dt

    s(i)j,t = s(i)j,t1 sin

    (i)j + s

    (i)j,t1 cos

    (i)j +

    (i)2 dt

    Box-Cox transformation

  • TBATS model

    yt = observation at time t

    y()t =

    {(yt 1)/ if 6= 0;log yt if = 0.

    y()t = `t1 + bt1 +Mi=1

    s(i)tmi + dt

    `t = `t1 + bt1 + dt

    bt = (1 )b+ bt1 + dt

    dt =pi=1

    idti +qj=1

    jtj + t

    s(i)t =kij=1

    s(i)j,t

    Forecasting using R Time series with complex seasonality 13

    s(i)j,t = s(i)j,t1 cos

    (i)j + s

    (i)j,t1 sin

    (i)j +

    (i)1 dt

    s(i)j,t = s(i)j,t1 sin

    (i)j + s

    (i)j,t1 cos

    (i)j +

    (i)2 dt

    Box-Cox transformation

    M seasonal periods

  • TBATS model

    yt = observation at time t

    y()t =

    {(yt 1)/ if 6= 0;log yt if = 0.

    y()t = `t1 + bt1 +Mi=1

    s(i)tmi + dt

    `t = `t1 + bt1 + dt

    bt = (1 )b+ bt1 + dt

    dt =pi=1

    idti +qj=1

    jtj + t

    s(i)t =kij=1

    s(i)j,t

    Forecasting using R Time series with complex seasonality 13

    s(i)j,t = s(i)j,t1 cos

    (i)j + s

    (i)j,t1 sin

    (i)j +

    (i)1 dt

    s(i)j,t = s(i)j,t1 sin

    (i)j + s

    (i)j,t1 cos

    (i)j +

    (i)2 dt

    Box-Cox transformation

    M seasonal periods

    global and local trend

  • TBATS model

    yt = observation at time t

    y()t =

    {(yt 1)/ if 6= 0;log yt if = 0.

    y()t = `t1 + bt1 +Mi=1

    s(i)tmi + dt

    `t = `t1 + bt1 + dt

    bt = (1 )b+ bt1 + dt

    dt =pi=1

    idti +qj=1

    jtj + t

    s(i)t =kij=1

    s(i)j,t

    Forecasting using R Time series with complex seasonality 13

    s(i)j,t = s(i)j,t1 cos

    (i)j + s

    (i)j,t1 sin

    (i)j +

    (i)1 dt

    s(i)j,t = s(i)j,t1 sin

    (i)j + s

    (i)j,t1 cos

    (i)j +

    (i)2 dt

    Box-Cox transformation

    M seasonal periods

    global and local trend

    ARMA error

  • TBATS model

    yt = observation at time t

    y()t =

    {(yt 1)/ if 6= 0;log yt if = 0.

    y()t = `t1 + bt1 +Mi=1

    s(i)tmi + dt

    `t = `t1 + bt1 + dt

    bt = (1 )b+ bt1 + dt

    dt =pi=1

    idti +qj=1

    jtj + t

    s(i)t =kij=1

    s(i)j,t

    Forecasting using R Time series with complex seasonality 13

    s(i)j,t = s(i)j,t1 cos

    (i)j + s

    (i)j,t1 sin

    (i)j +

    (i)1 dt

    s(i)j,t = s(i)j,t1 sin

    (i)j + s

    (i)j,t1 cos

    (i)j +

    (i)2 dt

    Box-Cox transformation

    M seasonal periods

    global and local trend

    ARMA error

    Fourier-like seasonalterms

  • TBATS model

    yt = observation at time t

    y()t =

    {(yt 1)/ if 6= 0;log yt if = 0.

    y()t = `t1 + bt1 +Mi=1

    s(i)tmi + dt

    `t = `t1 + bt1 + dt

    bt = (1 )b+ bt1 + dt

    dt =pi=1

    idti +qj=1

    jtj + t

    s(i)t =kij=1

    s(i)j,t

    Forecasting using R Time series with complex seasonality 13

    s(i)j,t = s(i)j,t1 cos

    (i)j + s

    (i)j,t1 sin

    (i)j +

    (i)1 dt

    s(i)j,t = s(i)j,t1 sin

    (i)j + s

    (i)j,t1 cos

    (i)j +

    (i)2 dt

    Box-Cox transformation

    M seasonal periods

    global and local trend

    ARMA error

    Fourier-like seasonalterms

    TBATSTrigonometric

    Box-Cox

    ARMA

    Trend

    Seasonal

  • Examples

    fit

  • Examples

    fit

  • Examples

    fit

  • Outline

    1 Cross-validation

    2 Time series with complex seasonality

    3 Forecasting proportions

    4 Some case studies

    5 Forecasting resources

    Forecasting using R Forecasting proportions 17

  • Forecasting proportions

    Simple approachUse a logit transformation on proportions:f (u) = log

    (u

    1u)

    Then build model and back-transform the forecasts.More complicated:

    Let yt be a binary variable (e.g., water quality abovesome threshold value on day t).Use a generalized linear model with a latentautocorrelated process. e.g., Pr(yt) = f1( + xt + ut)where xt is a vector of predictors and ut is a correlatedprocess.Theory and methodology not well developed and verylittle software available.bild and gee packages allows some simple correlationstructures.

    Forecasting using R Forecasting proportions 18

  • Forecasting proportions

    Simple approachUse a logit transformation on proportions:f (u) = log

    (u

    1u)

    Then build model and back-transform the forecasts.More complicated:

    Let yt be a binary variable (e.g., water quality abovesome threshold value on day t).Use a generalized linear model with a latentautocorrelated process. e.g., Pr(yt) = f1( + xt + ut)where xt is a vector of predictors and ut is a correlatedprocess.Theory and methodology not well developed and verylittle software available.bild and gee packages allows some simple correlationstructures.

    Forecasting using R Forecasting proportions 18

  • Forecasting proportions

    Simple approachUse a logit transformation on proportions:f (u) = log

    (u

    1u)

    Then build model and back-transform the forecasts.More complicated:

    Let yt be a binary variable (e.g., water quality abovesome threshold value on day t).Use a generalized linear model with a latentautocorrelated process. e.g., Pr(yt) = f1( + xt + ut)where xt is a vector of predictors and ut is a correlatedprocess.Theory and methodology not well developed and verylittle software available.bild and gee packages allows some simple correlationstructures.

    Forecasting using R Forecasting proportions 18

  • Forecasting proportions

    Simple approachUse a logit transformation on proportions:f (u) = log

    (u

    1u)

    Then build model and back-transform the forecasts.More complicated:

    Let yt be a binary variable (e.g., water quality abovesome threshold value on day t).Use a generalized linear model with a latentautocorrelated process. e.g., Pr(yt) = f1( + xt + ut)where xt is a vector of predictors and ut is a correlatedprocess.Theory and methodology not well developed and verylittle software available.bild and gee packages allows some simple correlationstructures.

    Forecasting using R Forecasting proportions 18

  • Forecasting proportions

    Simple approachUse a logit transformation on proportions:f (u) = log

    (u

    1u)

    Then build model and back-transform the forecasts.More complicated:

    Let yt be a binary variable (e.g., water quality abovesome threshold value on day t).Use a generalized linear model with a latentautocorrelated process. e.g., Pr(yt) = f1( + xt + ut)where xt is a vector of predictors and ut is a correlatedprocess.Theory and methodology not well developed and verylittle software available.bild and gee packages allows some simple correlationstructures.

    Forecasting using R Forecasting proportions 18

  • Forecasting proportions

    Simple approachUse a logit transformation on proportions:f (u) = log

    (u

    1u)

    Then build model and back-transform the forecasts.More complicated:

    Let yt be a binary variable (e.g., water quality abovesome threshold value on day t).Use a generalized linear model with a latentautocorrelated process. e.g., Pr(yt) = f1( + xt + ut)where xt is a vector of predictors and ut is a correlatedprocess.Theory and methodology not well developed and verylittle software available.bild and gee packages allows some simple correlationstructures.

    Forecasting using R Forecasting proportions 18

  • Forecasting proportions

    Simple approachUse a logit transformation on proportions:f (u) = log

    (u

    1u)

    Then build model and back-transform the forecasts.More complicated:

    Let yt be a binary variable (e.g., water quality abovesome threshold value on day t).Use a generalized linear model with a latentautocorrelated process. e.g., Pr(yt) = f1( + xt + ut)where xt is a vector of predictors and ut is a correlatedprocess.Theory and methodology not well developed and verylittle software available.bild and gee packages allows some simple correlationstructures.

    Forecasting using R Forecasting proportions 18

  • Outline

    1 Cross-validation

    2 Time series with complex seasonality

    3 Forecasting proportions

    4 Some case studies

    5 Forecasting resources

    Forecasting using R Some case studies 19

  • CASE STUDY 1: Paperware company

    Forecasting using R Some case studies 20

    Problem: Want forecasts of each ofhundreds of items. Series can bestationary, trended or seasonal. Theycurrently have a large forecastingprogram written in-house but it doesntseem to produce sensible forecasts.They want me to tell them what iswrong and fix it.

  • CASE STUDY 1: Paperware company

    Forecasting using R Some case studies 20

    Problem: Want forecasts of each ofhundreds of items. Series can bestationary, trended or seasonal. Theycurrently have a large forecastingprogram written in-house but it doesntseem to produce sensible forecasts.They want me to tell them what iswrong and fix it.

    Additional informationProgram written in COBOL making numerical calculationslimited. It is not possible to do any optimisation.

  • CASE STUDY 1: Paperware company

    Forecasting using R Some case studies 20

    Problem: Want forecasts of each ofhundreds of items. Series can bestationary, trended or seasonal. Theycurrently have a large forecastingprogram written in-house but it doesntseem to produce sensible forecasts.They want me to tell them what iswrong and fix it.

    Additional informationProgram written in COBOL making numerical calculationslimited. It is not possible to do any optimisation.Their programmer has little experience in numericalcomputing.

  • CASE STUDY 1: Paperware company

    Forecasting using R Some case studies 20

    Problem: Want forecasts of each ofhundreds of items. Series can bestationary, trended or seasonal. Theycurrently have a large forecastingprogram written in-house but it doesntseem to produce sensible forecasts.They want me to tell them what iswrong and fix it.

    Additional informationProgram written in COBOL making numerical calculationslimited. It is not possible to do any optimisation.Their programmer has little experience in numericalcomputing.They employ no statisticians and want the program toproduce forecasts automatically.

  • CASE STUDY 1: Paperware company

    Methods currently used

    A 12 month average

    C 6 month average

    E straight line regression over last 12 months

    G straight line regression over last 6 months

    H average slope between last years and thisyears values.(Equivalent to differencing at lag 12 andtaking mean.)

    I Same as H except over 6 months.

    K I couldnt understand the explanation.

    Forecasting using R Some case studies 21

  • CASE STUDY 2: PBS

    Forecasting using R Some case studies 22

  • CASE STUDY 2: PBS

    The Pharmaceutical Benefits Scheme (PBS) isthe Australian government drugs subsidy scheme.

    Many drugs bought from pharmacies aresubsidised to allow more equitable access tomodern drugs.

    The cost to government is determined by thenumber and types of drugs purchased.Currently nearly 1% of GDP.

    The total cost is budgeted based on forecastsof drug usage.

    Forecasting using R Some case studies 23

  • CASE STUDY 2: PBS

    The Pharmaceutical Benefits Scheme (PBS) isthe Australian government drugs subsidy scheme.

    Many drugs bought from pharmacies aresubsidised to allow more equitable access tomodern drugs.

    The cost to government is determined by thenumber and types of drugs purchased.Currently nearly 1% of GDP.

    The total cost is budgeted based on forecastsof drug usage.

    Forecasting using R Some case studies 23

  • CASE STUDY 2: PBS

    The Pharmaceutical Benefits Scheme (PBS) isthe Australian government drugs subsidy scheme.

    Many drugs bought from pharmacies aresubsidised to allow more equitable access tomodern drugs.

    The cost to government is determined by thenumber and types of drugs purchased.Currently nearly 1% of GDP.

    The total cost is budgeted based on forecastsof drug usage.

    Forecasting using R Some case studies 23

  • CASE STUDY 2: PBS

    The Pharmaceutical Benefits Scheme (PBS) isthe Australian government drugs subsidy scheme.

    Many drugs bought from pharmacies aresubsidised to allow more equitable access tomodern drugs.

    The cost to government is determined by thenumber and types of drugs purchased.Currently nearly 1% of GDP.

    The total cost is budgeted based on forecastsof drug usage.

    Forecasting using R Some case studies 23

  • CASE STUDY 2: PBS

    Forecasting using R Some case studies 24

  • CASE STUDY 2: PBS

    In 2001: $4.5 billion budget, under-forecastedby $800 million.Thousands of products. Seasonal demand.Subject to covert marketing, volatile products,uncontrollable expenditure.Although monthly data available for 10 years,data are aggregated to annual values, and onlythe first three years are used in estimating theforecasts.All forecasts being done with the FORECASTfunction in MS-Excel!

    Problem: How to do the forecasting better?

    Forecasting using R Some case studies 25

  • CASE STUDY 2: PBS

    In 2001: $4.5 billion budget, under-forecastedby $800 million.Thousands of products. Seasonal demand.Subject to covert marketing, volatile products,uncontrollable expenditure.Although monthly data available for 10 years,data are aggregated to annual values, and onlythe first three years are used in estimating theforecasts.All forecasts being done with the FORECASTfunction in MS-Excel!

    Problem: How to do the forecasting better?

    Forecasting using R Some case studies 25

  • CASE STUDY 2: PBS

    In 2001: $4.5 billion budget, under-forecastedby $800 million.Thousands of products. Seasonal demand.Subject to covert marketing, volatile products,uncontrollable expenditure.Although monthly data available for 10 years,data are aggregated to annual values, and onlythe first three years are used in estimating theforecasts.All forecasts being done with the FORECASTfunction in MS-Excel!

    Problem: How to do the forecasting better?

    Forecasting using R Some case studies 25

  • CASE STUDY 2: PBS

    In 2001: $4.5 billion budget, under-forecastedby $800 million.Thousands of products. Seasonal demand.Subject to covert marketing, volatile products,uncontrollable expenditure.Although monthly data available for 10 years,data are aggregated to annual values, and onlythe first three years are used in estimating theforecasts.All forecasts being done with the FORECASTfunction in MS-Excel!

    Problem: How to do the forecasting better?

    Forecasting using R Some case studies 25

  • CASE STUDY 2: PBS

    In 2001: $4.5 billion budget, under-forecastedby $800 million.Thousands of products. Seasonal demand.Subject to covert marketing, volatile products,uncontrollable expenditure.Although monthly data available for 10 years,data are aggregated to annual values, and onlythe first three years are used in estimating theforecasts.All forecasts being done with the FORECASTfunction in MS-Excel!

    Problem: How to do the forecasting better?

    Forecasting using R Some case studies 25

  • CASE STUDY 2: PBS

    In 2001: $4.5 billion budget, under-forecastedby $800 million.Thousands of products. Seasonal demand.Subject to covert marketing, volatile products,uncontrollable expenditure.Although monthly data available for 10 years,data are aggregated to annual values, and onlythe first three years are used in estimating theforecasts.All forecasts being done with the FORECASTfunction in MS-Excel!

    Problem: How to do the forecasting better?

    Forecasting using R Some case studies 25

  • CASE STUDY 3: Airline

    Forecasting using R Some case studies 26

  • CASE STUDY 3: Airline

    Forecasting using R Some case studies 27

    First class passengers: MelbourneSydney

    Year

    1988 1989 1990 1991 1992 1993

    0.0

    1.0

    2.0

    Business class passengers: MelbourneSydney

    Year

    1988 1989 1990 1991 1992 1993

    02

    46

    8

    Economy class passengers: MelbourneSydney

    Year

    1988 1989 1990 1991 1992 1993

    010

    2030

  • CASE STUDY 3: Airline

    Forecasting using R Some case studies 27

    First class passengers: MelbourneSydney

    Year

    1988 1989 1990 1991 1992 1993

    0.0

    1.0

    2.0

    Business class passengers: MelbourneSydney

    Year

    1988 1989 1990 1991 1992 1993

    02

    46

    8

    Economy class passengers: MelbourneSydney

    Year

    1988 1989 1990 1991 1992 1993

    010

    2030

    Not the real data!Or is it?

  • CASE STUDY 3: Airline

    Problem: how to forecast passenger traffic onmajor routes.

    Additional information

    They can provide a large amount of data onprevious routes.

    Traffic is affected by school holidays, specialevents such as the Grand Prix, advertisingcampaigns, competition behaviour, etc.

    They have a highly capable team of people whoare able to do most of the computing.

    Forecasting using R Some case studies 28

  • CASE STUDY 3: Airline

    Problem: how to forecast passenger traffic onmajor routes.

    Additional information

    They can provide a large amount of data onprevious routes.

    Traffic is affected by school holidays, specialevents such as the Grand Prix, advertisingcampaigns, competition behaviour, etc.

    They have a highly capable team of people whoare able to do most of the computing.

    Forecasting using R Some case studies 28

  • CASE STUDY 3: Airline

    Problem: how to forecast passenger traffic onmajor routes.

    Additional information

    They can provide a large amount of data onprevious routes.

    Traffic is affected by school holidays, specialevents such as the Grand Prix, advertisingcampaigns, competition behaviour, etc.

    They have a highly capable team of people whoare able to do most of the computing.

    Forecasting using R Some case studies 28

  • CASE STUDY 3: Airline

    Problem: how to forecast passenger traffic onmajor routes.

    Additional information

    They can provide a large amount of data onprevious routes.

    Traffic is affected by school holidays, specialevents such as the Grand Prix, advertisingcampaigns, competition behaviour, etc.

    They have a highly capable team of people whoare able to do most of the computing.

    Forecasting using R Some case studies 28

  • Outline

    1 Cross-validation

    2 Time series with complex seasonality

    3 Forecasting proportions

    4 Some case studies

    5 Forecasting resources

    Forecasting using R Forecasting resources 29

  • Useful resources

    Forecasting using R Forecasting resources 30

    Organization: International Institute

    of Forecasters.

    Conferences: International

    Symposium onForecasting. June2014, Rotterdam.

    Journals: International Journal

    of Forecasting Foresight

  • Useful resources

    Forecasting using R Forecasting resources 30

    Organization: International Institute

    of Forecasters.

    Conferences: International

    Symposium onForecasting. June2014, Rotterdam.

    Journals: International Journal

    of Forecasting Foresight

  • Useful resources

    Forecasting using R Forecasting resources 30

    Organization: International Institute

    of Forecasters.

    Conferences: International

    Symposium onForecasting. June2014, Rotterdam.

    Journals: International Journal

    of Forecasting Foresight

    THE INTERNATIONAL JOURNAL OF APPLIED FORECASTINGSpring 2013 Issue 29

    THE INTERNATIONAL JOURNAL OF APPLIED FORECASTING

    5 Forecasting revenue in Professional Service Companies

    14 Forecast value added: A Reality Check on Forecasting Practices

    19 s&oP and Financial Planning

    26 cPFr: Collaboration Beyond S&OP

    39 Progress in Forecasting rare events

    50 Review of "global trends 2030: alternative Worlds"

  • Useful resources

    Forecasting using R Forecasting resources 30

    Organization: International Institute

    of Forecasters.

    Conferences: International

    Symposium onForecasting. June2014, Rotterdam.

    Journals: International Journal

    of Forecasting Foresight

    THE INTERNATIONAL JOURNAL OF APPLIED FORECASTINGSpring 2013 Issue 29

    THE INTERNATIONAL JOURNAL OF APPLIED FORECASTING

    5 Forecasting revenue in Professional Service Companies

    14 Forecast value added: A Reality Check on Forecasting Practices

    19 s&oP and Financial Planning

    26 cPFr: Collaboration Beyond S&OP

    39 Progress in Forecasting rare events

    50 Review of "global trends 2030: alternative Worlds"

    Links to all of the above atwww.forecasters.org.

  • Final comments

    Revolution Analytics will send you coursecompletion certificates.Please vote on the students who have mademost contribution to class. You will receive avoting form by email. I will announce theresults on Piazza.I will continue to answer questions on Piazzauntil Christmas.A discussion forum for forecasting planned forOTexts. Should be launched in early 2014.The FPP book will be available in print onAmazon by February 2014. Maybe a kindleversion will follow.

    Forecasting using R Forecasting resources 31

  • Final comments

    Revolution Analytics will send you coursecompletion certificates.Please vote on the students who have mademost contribution to class. You will receive avoting form by email. I will announce theresults on Piazza.I will continue to answer questions on Piazzauntil Christmas.A discussion forum for forecasting planned forOTexts. Should be launched in early 2014.The FPP book will be available in print onAmazon by February 2014. Maybe a kindleversion will follow.

    Forecasting using R Forecasting resources 31

  • Final comments

    Revolution Analytics will send you coursecompletion certificates.Please vote on the students who have mademost contribution to class. You will receive avoting form by email. I will announce theresults on Piazza.I will continue to answer questions on Piazzauntil Christmas.A discussion forum for forecasting planned forOTexts. Should be launched in early 2014.The FPP book will be available in print onAmazon by February 2014. Maybe a kindleversion will follow.

    Forecasting using R Forecasting resources 31

  • Final comments

    Revolution Analytics will send you coursecompletion certificates.Please vote on the students who have mademost contribution to class. You will receive avoting form by email. I will announce theresults on Piazza.I will continue to answer questions on Piazzauntil Christmas.A discussion forum for forecasting planned forOTexts. Should be launched in early 2014.The FPP book will be available in print onAmazon by February 2014. Maybe a kindleversion will follow.

    Forecasting using R Forecasting resources 31

  • Final comments

    Revolution Analytics will send you coursecompletion certificates.Please vote on the students who have mademost contribution to class. You will receive avoting form by email. I will announce theresults on Piazza.I will continue to answer questions on Piazzauntil Christmas.A discussion forum for forecasting planned forOTexts. Should be launched in early 2014.The FPP book will be available in print onAmazon by February 2014. Maybe a kindleversion will follow.

    Forecasting using R Forecasting resources 31

    Cross-validationTime series with complex seasonalityForecasting proportionsSome case studiesForecasting resources