Forecasting Time Series Using R - Rob J. Hyndman

2y ago
17 Views
2 Downloads
1.39 MB
152 Pages
Last View : 1m ago
Last Download : 3m ago
Upload by : Jewel Payne
Transcription

Forecasting time series using R1Forecasting time seriesusing RProfessor Rob J Hyndman27 October 2011

Forecasting time series using ROutline1Time series in R2Some simple forecasting methods3Measuring forecast accuracy4Exponential smoothing5Box-Cox transformations6ARIMA forecasting7Difficult seasonality8forecast() function9Time series cross-validationTime series in R2

Forecasting time series using RTime series in R3Australian GDPausgdp - ts(scan("gdp.dat"),frequency 4,start 1971 2/4)

Forecasting time series using RTime series in R3Australian GDPausgdp - ts(scan("gdp.dat"),frequency 4,start 1971 2/4)Class: tsPrint and plotting methods available.

Forecasting time series using RTime series in R3Australian GDPausgdp - ts(scan("gdp.dat"),frequency 4,start 1971 2/4)Class: tsPrint and plotting methods available. ausgdpQtr1 Qtr2 Qtr3 Qtr419714612 46511972 4645 4615 4645 47221973 4780 4830 4887 49331974 4921 4875 4867 49051975 4938 4934 4942 49791976 5028 5079 5112 51271977 5130 5101 5072 5069

Forecasting time series using RTime series in R ralian GDP197519801985Time199019954

Forecasting time series using RTime series in RResidential electricity sales elecsalesTime Series:Start 1989End 2008Frequency 1[1] 2354.34 2379.71 2318.52 2468.99 2386.09 2569.47[7] 2575.72 2762.72 2844.50 3000.70 3108.10 3357.50[13] 3075.70 3180.60 3221.60 3176.20 3430.60 3527.48[19] 3637.89 3655.005

Forecasting time series using RTime series in RUseful packagesTime series task view: l6

Forecasting time series using RTime series in RUseful packagesTime series task view: lforecastfor forecasting functionstseriesfor unit root tests and GARCH modelsMcompfor the M-competition andM3-competition datafmafor data from Makridakis,Wheelwright & Hyndman (1998)expsmooth for data from Hyndman et al. (2008)fppfor data from Hyndman &Athanasopoulos (forthcoming).6

Forecasting time series using RSome simple forecasting methodsOutline1Time series in R2Some simple forecasting methods3Measuring forecast accuracy4Exponential smoothing5Box-Cox transformations6ARIMA forecasting7Difficult seasonality8forecast() function9Time series cross-validation7

Forecasting time series using RSome simple forecasting methodsSome simple forecasting methodsMean methodForecast of all future values isequal to mean of historical data{y1, . . . , yn}.8

Forecasting time series using RSome simple forecasting methodsSome simple forecasting methodsMean methodForecast of all future values isequal to mean of historical data{y1, . . . , yn}.Forecasts:ŷn h n ȳ (y1 · · · yn )/n8

Forecasting time series using RSome simple forecasting methodsSome simple forecasting methodsNaïve methodForecasts equal to last observedvalue.9

Forecasting time series using RSome simple forecasting methodsSome simple forecasting methodsNaïve methodForecasts equal to last observedvalue.Forecasts: ŷn h n yn .9

Forecasting time series using RSome simple forecasting methodsSome simple forecasting methodsNaïve methodForecasts equal to last observedvalue.Forecasts: ŷn h n yn .Optimal for efficient stock markets.9

Forecasting time series using RSome simple forecasting methodsSome simple forecasting methodsSeasonal naïve methodForecasts equal to last value fromsame season.10

Forecasting time series using RSome simple forecasting methodsSome simple forecasting methodsSeasonal naïve methodForecasts equal to last value fromsame season.Forecasts: ŷn h n yn m wherem seasonal period andk b(h 1)/mc 1.10

Forecasting time series using RSome simple forecasting methodsSome simple forecasting methodsDrift methodForecasts equal to last value plus averagechange.11

Forecasting time series using RSome simple forecasting methodsSome simple forecasting methodsDrift methodForecasts equal to last value plus averagechange.Forecasts:ŷn h n yn yn hn 1hn 1nX(yt yt 1 )t 2(yn y1 ).11

Forecasting time series using RSome simple forecasting methodsSome simple forecasting methodsDrift methodForecasts equal to last value plus averagechange.Forecasts:ŷn h n yn yn hn 1hn 1nX(yt yt 1 )t 2(yn y1 ).Equivalent to extrapolating a line drawnbetween first and last observations.11

Forecasting time series using RSome simple forecasting methodsSome simple forecasting methods100012001400160018002000Australian annual beer production196019701980Year1990200012

Forecasting time series using RSome simple forecasting methodsSome simple forecasting methodsMean methodNaive methodDrift model100012001400160018002000Australian annual beer production196019701980Year1990200012

Forecasting time series using RSome simple forecasting methodsSome simple forecasting methodsMean: meanf(x,h 20)13

Forecasting time series using RSome simple forecasting methodsSome simple forecasting methodsMean: meanf(x,h 20)Naive: naive(x,h 20) or rwf(x,h 20)13

Forecasting time series using RSome simple forecasting methodsSome simple forecasting methodsMean: meanf(x,h 20)Naive: naive(x,h 20) or rwf(x,h 20)Seasonal naive: snaive(x,h 20)13

Forecasting time series using RSome simple forecasting methodsSome simple forecasting methodsMean: meanf(x,h 20)Naive: naive(x,h 20) or rwf(x,h 20)Seasonal naive: snaive(x,h 20)Drift: rwf(x,drift TRUE,h 20)13

Forecasting time series using RSome simple forecasting methodsforecast objects in RFunctions that output a forecast object:meanf()naive(), snaive()rwf()croston()stlf()ses()holt(), hw()splinefthetafforecast()14

Forecasting time series using RSome simple forecasting methodsforecast objects in RFunctions that output a forecast object:meanf()naive(), snaive()rwf()croston()stlf()forecast class containsOriginal seriesses()holt(), hw()splinefthetafforecast()14

Forecasting time series using RSome simple forecasting methodsforecast objects in RFunctions that output a forecast object:meanf()naive(), snaive()rwf()croston()stlf()forecast class containsOriginal seriesPoint forecastsses()holt(), hw()splinefthetafforecast()14

Forecasting time series using RSome simple forecasting methodsforecast objects in RFunctions that output a forecast object:meanf()naive(), snaive()rwf()croston()stlf()forecast class containsOriginal seriesPoint forecastsPrediction intervalses()holt(), hw()splinefthetafforecast()14

Forecasting time series using RSome simple forecasting methodsforecast objects in RFunctions that output a forecast object:meanf()naive(), snaive()rwf()croston()stlf()ses()holt(), hw()splinefthetafforecast()forecast class containsOriginal seriesPoint forecastsPrediction intervalForecasting method used14

Forecasting time series using RSome simple forecasting methodsforecast objects in RFunctions that output a forecast object:meanf()naive(), snaive()rwf()croston()stlf()ses()holt(), hw()splinefthetafforecast()forecast class containsOriginal seriesPoint forecastsPrediction intervalForecasting method usedResiduals and in-sample one-step forecasts14

Forecasting time series using RMeasuring forecast accuracyOutline1Time series in R2Some simple forecasting methods3Measuring forecast accuracy4Exponential smoothing5Box-Cox transformations6ARIMA forecasting7Difficult seasonality8forecast() function9Time series cross-validation15

Forecasting time series using RMeasuring forecast accuracyMeasures of forecast accuracyLet yt denote the tth observation and ft denote itsforecast, where t 1, . . . , n. Then the followingmeasures are useful.MAE n 1nX yt ft t 1nMSE n 1X(yt ft )2vunXut 1RMSE n(yt ft )2t 1t 1nMAPE 100n 1Xt 1 yt ft / yt 16

Forecasting time series using RMeasuring forecast accuracyMeasures of forecast accuracyLet yt denote the tth observation and ft denote itsforecast, where t 1, . . . , n. Then the followingmeasures are useful.MAE n 1nX yt ft t 1nMSE n 1X(yt ft )2vunXut 1RMSE n(yt ft )2t 1t 1nMAPE 100n 1X yt ft / yt t 1MAE, MSE, RMSE are all scale dependent.16

Forecasting time series using RMeasuring forecast accuracyMeasures of forecast accuracyLet yt denote the tth observation and ft denote itsforecast, where t 1, . . . , n. Then the followingmeasures are useful.MAE n 1nX yt ft t 1nMSE n 1X(yt ft )2vunXut 1RMSE n(yt ft )2t 1t 1nMAPE 100n 1X yt ft / yt t 1MAE, MSE, RMSE are all scale dependent.MAPE is scale independent but is only sensible ifyt 0 for all i, and y has a natural zero.16

Forecasting time series using RMeasuring forecast accuracyMeasures of forecast accuracyMean Absolute Scaled ErrorMASE n 1nX yt ft /qt 1where q is a stable measure of the scale of thetime series {yt }.17

Forecasting time series using RMeasuring forecast accuracyMeasures of forecast accuracyMean Absolute Scaled ErrorMASE n 1nX yt ft /qt 1where q is a stable measure of the scale of thetime series {yt }.Proposed by Hyndman and Koehler (IJF, 2006)17

Forecasting time series using RMeasuring forecast accuracyMeasures of forecast accuracyMean Absolute Scaled ErrorMASE n 1nX yt ft /qt 1where q is a stable measure of the scale of thetime series {yt }.For non-seasonal time series, 1q (n 1)nX yt yt 1 t 2works well. Then MASE is equivalent to MAErelative to a naive method.17

Forecasting time series using RMeasuring forecast accuracyMeasures of forecast accuracyMean Absolute Scaled ErrorMASE n 1nX yt ft /qt 1where q is a stable measure of the scale of thetime series {yt }.For seasonal time series, 1q (n m)nX yt yt m t m 1works well. Then MASE is equivalent to MAErelative to a seasonal naive method.17

Forecasting time series using RMeasuring forecast accuracyMeasures of forecast accuracyMean methodNaive methodDrift model100012001400160018002000Australian annual beer production196019701980Year1990200018

Forecasting time series using RMeasuring forecast accuracyMeasures of forecast accuracyMean methodNaive methodDrift model100012001400160018002000Australian annual beer production196019701980Year1990200018

Forecasting time series using RMeasuring forecast accuracyMeasures of forecast accuracyMean E2.6156MASE1.0378MAPE7.0924MASE2.8169Naïve methodRMSE50.2382MAE44.6250Drift methodRMSE134.6788MAE121.125019

Forecasting time series using RExponential smoothingOutline1Time series in R2Some simple forecasting methods3Measuring forecast accuracy4Exponential smoothing5Box-Cox transformations6ARIMA forecasting7Difficult seasonality8forecast() function9Time series cross-validation20

Forecasting time series using RExponential smoothingExponential smoothingClassic ReferenceMakridakis, Wheelwright andHyndman (1998) Forecasting:methods and applications, 3rded., Wiley: NY.21

Forecasting time series using RExponential smoothingExponential smoothingClassic ReferenceMakridakis, Wheelwright andHyndman (1998) Forecasting:methods and applications, 3rded., Wiley: NY.Current ReferenceHyndman, Koehler, Ord andSnyder (2008) Forecasting withexponential smoothing: thestate space approach,Springer-Verlag: Berlin.21

Forecasting time series using RExponential smoothingExponential smoothing methodsTrendComponentSeasonal ComponentNAM(None) (Additive) ,MAd(Additive damped)Ad ,NAd ,AAd ,MM(Multiplicative)M,NM,AM,MMd(Multiplicative damped)Md ,NMd ,AMd ,M22

Forecasting time series using RExponential smoothingExponential smoothing methodsTrendComponentSeasonal ComponentNAM(None) (Additive) ,MAd(Additive damped)Ad ,NAd ,AAd ,MM(Multiplicative)M,NM,AM,MMd(Multiplicative damped)Md ,NMd ,AMd ,M(N,N):Simple exponential smoothing22

Forecasting time series using RExponential smoothingExponential smoothing methodsTrendComponentSeasonal ComponentNAM(None) (Additive) ,MAd(Additive damped)Ad ,NAd ,AAd ,MM(Multiplicative)M,NM,AM,MMd(Multiplicative damped)Md ,NMd ,AMd ,M(N,N):(A,N):Simple exponential smoothingHolt’s linear method22

Forecasting time series using RExponential smoothingExponential smoothing methodsTrendComponentSeasonal ComponentNAM(None) (Additive) ,MAd(Additive damped)Ad ,NAd ,AAd ,MM(Multiplicative)M,NM,AM,MMd(Multiplicative damped)Md ,NMd ,AMd ,M(N,N):(A,N):(A,A):Simple exponential smoothingHolt’s linear methodAdditive Holt-Winters’ method22

Forecasting time series using RExponential smoothingExponential smoothing methodsTrendComponentSeasonal ComponentNAM(None) (Additive) ,MAd(Additive damped)Ad ,NAd ,AAd ,MM(Multiplicative)M,NM,AM,MMd(Multiplicative damped)Md ,NMd ,AMd ,M(N,N):(A,N):(A,A):(A,M):Simple exponential smoothingHolt’s linear methodAdditive Holt-Winters’ methodMultiplicative Holt-Winters’ method22

Forecasting time series using RExponential smoothingExponential smoothing methodsTrendComponentSeasonal ComponentNAM(None) (Additive) ,MAd(Additive damped)Ad ,NAd ,AAd ,MM(Multiplicative)M,NM,AM,MMd(Multiplicative damped)Md ,NMd ,AMd ,M(N,N):(A,N):(A,A):(A,M):(Ad ,M):Simple exponential smoothingHolt’s linear methodAdditive Holt-Winters’ methodMultiplicative Holt-Winters’ methodDamped multiplicative Holt-Winters’ method22

Forecasting time series using RExponential smoothingExponential smoothing methodsTrendComponentSeasonal ComponentNAM(None) (Additive) ,MAd(Additive damped)Ad ,NAd ,AAd ,MM(Multiplicative)M,NM,AM,MMd(Multiplicative damped)Md ,NMd ,AMd ,M(N,N):(A,N):(A,A):(A,M):(Ad ,M):Simple exponential smoothingHolt’s linear methodAdditive Holt-Winters’ methodMultiplicative Holt-Winters’ methodDamped multiplicative Holt-Winters’ methodThere are 15 separate exponential smoothing methods.22

Forecasting time series using RExponential smoothingR functionsHoltWinters() implements methods(N,N), (A,N), (A,A) and (A,M). Initial statesare selected heuristically. Smoothingparameters are estimated by minimizingMSE.23

Forecasting time series using RExponential smoothingR functionsHoltWinters() implements methods(N,N), (A,N), (A,A) and (A,M). Initial statesare selected heuristically. Smoothingparameters are estimated by minimizingMSE.Use ets(x,model "ZMA",damped FALSE)to estimate parameters for the (M,A)method. All other methods similarly. Initialstates and smoothing parameters areestimated using maximum likelihoodestimation (see later).23

Forecasting time series using RExponential smoothingExponential smoothingSES100012001400160018002000Forecasts from ETS models1960197019801990200024

Forecasting time series using RExponential smoothingExponential smoothingSESHolts100012001400160018002000Forecasts from ETS models1960197019801990200024

Forecasting time series using RExponential smoothingExponential smoothingSESHoltsDamped Holts100012001400160018002000Forecasts from ETS models1960197019801990200024

Forecasting time series using RExponential smoothingExponential smoothingSESHoltsDamped HoltsAuto100012001400160018002000Forecasts from ETS models1960197019801990200024

Forecasting time series using RExponential smoothingExponential smoothingSESHoltsDamped HoltsAuto100012001400160018002000Forecasts from ETS models1960197019801990200024

Forecasting time series using RExponential smoothingMeasures of forecast accuracyMean E2.6156MASE1.0378MAPE1.3150MASE0.5210Naïve methodRMSE50.2382MAE44.6250Auto ETS modelRMSE27.3974MAE22.401425

Forecasting time series using RExponential smoothingExponential smoothingHW additive51015202530Forecasts from Holt Winters' additive method19952000200526

Forecasting time series using RExponential smoothingExponential smoothingHW additiveHW multiplicative51015202530Forecasts from Holt Winters' additive method19952000200526

Forecasting time series using RExponential smoothingExponential smoothingHW additiveHW multiplicativeAuto51015202530Forecasts from Holt Winters' additive method19952000200526

Forecasting time series using RExponential smoothingExponential smoothingHW additiveHW multiplicativeAuto51015202530Forecasts from Holt Winters' additive method19952000200526

Forecasting time series using RExponential smoothingExponential smoothingTrendComponentSeasonal ComponentNAM(None) (Additive) ,MAd(Additive damped)Ad ,NAd ,AAd ,MM(Multiplicative)M,NM,AM,MMd(Multiplicative damped)Md ,NMd ,AMd ,M27

Forecasting time series using RExponential smoothingExponential smoothingTrendComponentSeasonal ComponentNAM(None) (Additive) ,MAd(Additive damped)Ad ,NAd ,AAd ,MM(Multiplicative)M,NM,AM,MMd(Multiplicative damped)Md ,NMd ,AMd ,MGeneral notation ETS(Error,Trend,Seasonal)27

Forecasting time series using RExponential smoothingExponential smoothingTrendComponentSeasonal ComponentNAM(None) (Additive) ,MAd(Additive damped)Ad ,NAd ,AAd ,MM(Multiplicative)M,NM,AM,MMd(Multiplicative damped)Md ,NMd ,AMd ,MGeneral notation ETS(Error,Trend,Seasonal)ExponenTial Smoothing27

Forecasting time series using RExponential smoothingExponential smoothingTrendComponentSeasonal ComponentNAM(None) (Additive) ,MAd(Additive damped)Ad ,NAd ,AAd ,MM(Multiplicative)M,NM,AM,MMd(Multiplicative damped)Md ,NMd ,AMd ,MGeneral notation ETS(Error,Trend,Seasonal)ExponenTial SmoothingETS(A,N,N): Simple exponential smoothing withadditive errors27

Forecasting time series using RExponential smoothingExponential smoothingTrendComponentSeasonal ComponentNAM(None) (Additive) ,MAd(Additive damped)Ad ,NAd ,AAd ,MM(Multiplicative)M,NM,AM,MMd(Multiplicative damped)Md ,NMd ,AMd ,MGeneral notation ETS(Error,Trend,Seasonal)ExponenTial SmoothingETS(A,A,N): Holt’s linear method with additiveerrors27

Forecasting time series using RExponential smoothingExponential smoothingTrendComponentSeasonal ComponentNAM(None) (Additive) ,MAd(Additive damped)Ad ,NAd ,AAd ,MM(Multiplicative)M,NM,AM,MMd(Multiplicative damped)Md ,NMd ,AMd ,MGeneral notation ETS(Error,Trend,Seasonal)ExponenTial SmoothingETS(A,A,A): Additive Holt-Winters’ method withadditive errors27

Forecasting time series using RExponential smoothingExponential smoothingTrendComponentSeasonal ComponentNAM(None) (Additive) ,MAd(Additive damped)Ad ,NAd ,AAd ,MM(Multiplicative)M,NM,AM,MMd(Multiplicative damped)Md ,NMd ,AMd ,MGeneral notation ETS(Error,Trend,Seasonal)ExponenTial SmoothingETS(M,A,M): Multiplicative Holt-Winters’ methodwith multiplicative errors27

Forecasting time series using RExponential smoothingExponential smoothingTrendComponentSeasonal ComponentNAM(None) (Additive) ,MAd(Additive damped)Ad ,NAd ,AAd ,MM(Multiplicative)M,NM,AM,MMd(Multiplicative damped)Md ,NMd ,AMd ,MGeneral notation ETS(Error,Trend,Seasonal)ExponenTial SmoothingETS(A,Ad ,N): Damped trend method with additive errors27

Forecasting time series using RExponential smoothingExponential smoothingTrendComponentSeasonal ComponentNAM(None) (Additive) ,MAd(Additive damped)Ad ,NAd ,AAd ,MM(Multiplicative)M,NM,AM,MMd(Multiplicative damped)Md ,NMd ,AMd ,MGeneral notation ETS(Error,Trend,Seasonal)ExponenTial SmoothingThere are 30 separate models in the ETSframework27

Forecasting time series using RExponential smoothingExponential smoothingfit - ets(a10train)fit2 - ets(a10train,model "MMM",damped FALSE)fcast1 - forecast(fit, h 30)fcast2 - forecast(fit2, h 30)28

Forecasting time series using RExponential smoothingExponential smoothingfit - ets(a10train)fit2 - ets(a10train,model "MMM",damped FALSE)fcast1 - forecast(fit, h 30)fcast2 - forecast(fit2, h 30)ets(y, model "ZZZ", damped NULL, alpha NULL,beta NULL, gamma NULL, phi NULL,additive.only FALSE,lower c(rep(0.0001,3),0.80),upper c(rep(0.9999,3),0.98),opt.crit c("lik","amse","mse","sigma"), nmse 3,bounds c("both","usual","admissible"),ic c("aic","aicc","bic"), restrict TRUE)28

Forecasting time series using RExponential smoothingExponential smoothing fitETS(M,Ad,M)Smoothing parameters:alpha 0.303beta 0.0205gamma 1e-04phi 0.9797Initial states:l 3.2875b 0.0572s 0.9224 0.9252 0.8657 0.8763 0.7866 1.31491.2457 1.0641 1.0456 0.989 0.9772 0.9874sigma:0.0541AICAICcBIC636.3248 640.2479 690.028729

Forecasting time series using RExponential smoothingExponential smoothing fit2ETS(M,M,M)Smoothingalpha beta gamma parameters:0.38990.07661e-04Initial states:l 3.3312b 1.0057s 0.923 0.9302 0.8569 0.8681 0.7796 1.3341.2548 1.0505 1.0392 0.9867 0.9783 0.9988sigma:0.0565AICAICcBIC652.3502 655.8151 702.895130

Forecasting time series using RExponential smoothing31Forecast accuracy accuracy(fcast1,a10test)RMSEMAEMAPE3.3031418 2.7067125 12.3566798MASE2.6505174 accuracy(fcast2,a10test)RMSEMAEMAPE3.0001797 2.4143619 11.1033867MASE2.3642363

Forecasting time series using RExponential smoothingExponential smoothingets() functionAutomatically chooses a model by defaultusing the AIC, AICc or BIC.32

Forecasting time series using RExponential smoothingExponential smoothingets() functionAutomatically chooses a model by defaultusing the AIC, AICc or BIC.Can handle any combination of trend,seasonality and damping32

Forecasting time series using RExponential smoothingExponential smoothingets() functionAutomatically chooses a model by defaultusing the AIC, AICc or BIC.Can handle any combination of trend,seasonality and dampingProduces prediction intervals for everymodel32

Forecasting time series using RExponential smoothingExponential smoothingets() functionAutomatically chooses a model by defaultusing the AIC, AICc or BIC.Can handle any combination of trend,seasonality and dampingProduces prediction intervals for everymodelEnsures the parameters are admissible(equivalent to invertible)32

Forecasting time series using RExponential smoothingExponential smoothingets() functionAutomatically chooses a model by defaultusing the AIC, AICc or BIC.Can handle any combination of trend,seasonality and dampingProduces prediction intervals for everymodelEnsures the parameters are admissible(equivalent to invertible)Produces an object of class ets.32

Forecasting time series using RExponential smoothingExponential smoothingets() functionAutomatically chooses a model by defaultusing the AIC, AICc or BIC.Can handle any combination of trend,seasonality and dampingProduces prediction intervals for everymodelEnsures the parameters are admissible(equivalent to invertible)Produces an object of class ets.32

Forecasting time series using RExponential smoothingExponential smoothingets() functionAutomatically chooses a model by defaultusing the AIC, AICc or BIC.Can handle any combination of trend,seasonality and dampingProduces prediction intervals for everymodelEnsures the parameters are admissible(equivalent to invertible)Produces an object of class ets.Automatic ETS algorithm due to Hyndman et al(IJF, 2002), updated in Hyndman et al (2008).32

Forecasting time series using RExponential smoothingets objectsMethods: coef(), plot(),summary(), residuals(),fitted(), simulate() andforecast()Exponential smoothing33

Forecasting time series using RExponential smoothingExponential smoothingets objectsMethods: coef(), plot(),summary(), residuals(),fitted(), simulate() andforecast()plot() function shows time plots ofthe original time series along withthe extracted components (level,growth and seasonal).33

Forecasting time series using RExponential smoothingExponential smoothingets() function also allows refitting model tonew data set. fit - ets(a10train) test - ets(a10test, model fit) accuracy(test)RMSEMAE1.51968 1.28391MAPE6.50663MASE0.41450 accuracy(forecast(fit,30), a10test)RMSEMAEMAPEMASE3.30314 2.70672 12.35668 2.6505234

Forecasting time series using RExponential smoothingAutomatic forecastingWhy use an automatic procedure?1Most users are not very expert at fittingtime series models.35

Forecasting time series using RExponential smoothingAutomatic forecastingWhy use an automatic procedure?1Most users are not very expert at fittingtime series models.2Most experts cannot beat the bestautomatic algorithms.35

Forecasting time series using RExponential smoothingAutomatic forecastingWhy use an automatic procedure?1Most users are not very expert at fittingtime series models.2Most experts cannot beat the bestautomatic algorithms.3Many businesses and industries needthousands of forecasts every week/month.35

Forecasting time series using RExponential smoothingAutomatic forecastingWhy use an automatic procedure?1Most users are not very expert at fittingtime series models.2Most experts cannot beat the bestautomatic algorithms.3Many businesses and industries needthousands of forecasts every week/month.4Some multivariate forecasting methodsdepend on many univariate forecasts.35

Forecasting time series using RBox-Cox transformationsOutline1Time series in R2Some simple forecasting methods3Measuring forecast accuracy4Exponential smoothing5Box-Cox transformations6ARIMA forecasting7Difficult seasonality8forecast() function9Time series cross-validation36

Forecasting time series using RBox-Cox transformationsTransformations to stabilizethe varianceIf the data show different variation at different levels ofthe series, then a transformation can be useful.37

Forecasting time series using RBox-Cox transformationsTransformations to stabilizethe varianceIf the data show different variation at different levels ofthe series, then a transformation can be useful.Denote original observations as y1 , . . . , yn andtransformed observations as w1 , . . . , wn .37

Forecasting time series using RBox-Cox transformationsTransformations to stabilizethe varianceIf the data show different variation at different levels ofthe series, then a transformation can be useful.Denote original observations as y1 , . . . , yn andtransformed observations as w1 , . . . , wn . wt log(yt ),(ytλ 1)/λ,λ 0;λ 6 0.37

Forecasting time series using RBox-Cox transformationsTransformations to stabilizethe varianceIf the data show different variation at different levels ofthe series, then a transformation can be useful.Denote original observations as y1 , . . . , yn andtransformed observations as w1 , . . . , wn . wt log(yt ),(ytλ 1)/λ,λ 0;λ 6 0.λ 1: (No substantive transformation)37

Forecasting time series using RBox-Cox transformationsTransformations to stabilizethe varianceIf the data show different variation at different levels ofthe series, then a transformation can be useful.Denote original observations as y1 , . . . , yn andtransformed observations as w1 , . . . , wn . wt log(yt ),(ytλ 1)/λ,λ 0;λ 6 0.λ 1: (No substantive transformation)λ 12 : (Square root plus linear transformation)37

Forecasting time series using RBox-Cox transformationsTransformations to stabilizethe varianceIf the data show different variation at different levels ofthe series, then a transformation can be useful.Denote original observations as y1 , . . . , yn andtransformed observations as w1 , . . . , wn . wt log(yt ),(ytλ 1)/λ,λ 0;λ 6 0.λ 1: (No substantive transformation)λ 12 : (Square root plus linear transformation)λ 0: (Natural logarithm)37

Forecasting time series using RBox-Cox transformationsTransformations to stabilizethe varianceIf the data show different variation at different levels ofthe series, then a transformation can be useful.Denote original observations as y1 , . . . , yn andtransformed observations as w1 , . . . , wn . wt log(yt ),(ytλ 1)/λ,λ 0;λ 6 0.λ 1: (No substantive transformation)λ 12 : (Square root plus linear transformation)λ 0: (Natural logarithm)λ 1: (Inverse plus 1)37

Forecasting time series using RBox-Cox transformationsBox-Cox transformations2015105Transformed data25λ 1.0019952000Year200538

Forecasting time series using RBox-Cox transformationsBack-transformationWe must reverse the transformation (orback-transform) to obtain forecasts on theoriginal scale. The reverse Box-Coxtransformations are given by yt exp(wt ),(λWt 1)1/λ ,λ 0;λ 6 0.39

Forecasting time series using RBox-Cox transformationsBack-transformationWe must reverse the transformation (orback-transform) to obtain forecasts on theoriginal scale. The reverse Box-Coxtransformations are given by yt exp(wt ),(λWt 1)1/λ ,λ 0;λ 6 0.lam - BoxCox.lambda(a10) # 0.131fit - ets(a10, additive TRUE, lambda lam)plot(forecast(fit))plot(forecast(fit),include 60)39

Forecasting time series using RARIMA forecastingOutline1Time series in R2Some simple forecasting methods3Measuring forecast accuracy4Exponential smoothing5Box-Cox transformations6ARIMA forecasting7Difficult seasonality8forecast() function9Time series cross-validation40

Forecasting time series using RARIMA forecastingR functionsThe arima() function in the stats packageprovides seasonal and non-seasonal ARIMAmodel estimation including covariates.41

Forecasting time series using RARIMA forecastingR functionsThe arima() function in the stats packageprovides seasonal and non-seasonal ARIMAmodel estimation including covariates.However, it does not allow a constantunless the model is stationary41

Forecasting time series using RARIMA forecastingR functionsThe arima

Forecasting time series using R Some simple forecasting methods 14 forecast objects in R Functions that output a forecast object: meanf() naive(), snaive() rwf() croston() stlf() ses() holt(), hw() splinef thetaf forecast() forecast class contains Original series Point forecasts Predict

Related Documents:

Mar 13, 2003 · Although SVM has the above advantages, there is few studies for the application of SVM in nancial time-series forecasting. Mukherjee et al. [ 15] showed the ap-plicability of SVM to time-series forecasting. Recently, Tay and Cao [18] examined the predictability of nancial time-series including ve time series data with SVMs.

This article is organizedas follows: Section 2 introduces and defines the relational time series forecasting problem, which consists of relational time series classification (Section 2.1) and regression (Section 2.2). Next, Section 3 presents the relational time series representation learning for relational time series forecasting.

Although forecasting is a key business function, many organizations do not have a dedicated forecasting staff, or they may only have a small team. Therefore, a large degree of automation may be required to complete the forecasting process in the time available during each forecasting and planning cycle.

Forecasting economic time series using unobserved components time series models . time series analysis implies a speci c approach to the modelling of time series. It is somewhat di erent compared to the Box-Jenkins analysis. . and quarterly frequencies of time series), outliers, structural breaks and

Forecasting with R Nikolaos Kourentzesa,c, Fotios Petropoulosb,c aLancaster Centre for Forecasting, LUMS, Lancaster University, UK bCardi Business School, Cardi University, UK cForecasting Society, www.forsoc.net This document is supplementary material for the \Forecasting with R" workshop delivered at the International Symposium on Forecasting 2016 (ISF2016).

Importance of Forecasting Make informed business decisions Develop data-driven strategies Create proactive, not reactive, decision making 5 6. 4/28/2021 4 HR & Forecasting “Putting Forecasting in Focus” –SHRM article by Carolyn Hirschman Forecasting Strategic W

Introduction to Forecasting 1.1 Introduction What would happen if we could know more about the future? Forecasting is very important for: Business. Forecasting sales, prices, inventories, new entries. Finance. Forecasting financial risk, volatility forecasts. Stock prices? Economics. Unemplo

ects in business forecasting. Now they have joined forces to write a new textbook: Principles of Business Forecasting (PoBF; Ord & Fildes, 2013), a 506-page tome full of forecasting wisdom. Coverage and Sequencing PoBF follows a commonsense order, starting out with chapters on the why, how, and basic tools of forecasting.