1. Unemployment Rate of Bachelor’s Degree College Graduates aged from 20 to 24

Data Description

## [1] 239

a) Preliminary Graphs and Analysis

## [1] 0.6946745
  • Trend: Polynomial trend. Small peak around 2004, large peak around 2012, and troughs around 2006, 2018.

  • Seasonality: Strong seasonal pattern. Strong autocorrelation every 12 month. Peaks in June, July and January, and troughs in April and November.

  • Transformation: From the original time series plot, it is hard to tell whether we need transformation due to non-constatn variance. The plots of Box-Cox transformation of log and autoselection, we can see that they do not make much difference in forming constant variance. Therefore, we will not consider transformation. However, if we observe any non-constant variance issues in residual diagnostics in ant of our model, we will apply Box-Cox transformation.

b) Basic Forecasting

To determine which basic forecasting method performs the best, we will split the data into training and test set and test which method gives the lowest accuracy error measures, as well as checking residuals. Before starting this process, let’s see if there is any methods that may not be important to even consider.

  • Naive: Since we know that this data is seasonal, Seasonal Naive method will most likely perform better than naive method. Therefore, we will not consider Naive method.

  • Average: This may perform better than any other methods since the data has overall cyclical trend not exactly increasing or decreasing.

  • Seasonal Naive: This will perform better than naive method, but still it does not take any overall trend into account. Still, we will compare the result.

  • Naive with Drift: This will be affected by the seasonal variation of the endpoints, so it will not be accurate. However, we will still compare the result.

Test/Training Set

Since the length of our data set is 239, we will split them into 200 and 39 (about 20% of training set).

Fitting & Plotting

  • Looking at the plot, we can see that Seasonal Naive method is forecasting very close to the actual values. This may be due to the fact that there has not been a dramatic overal trend change in the recent 5 years of data that include test set.

Residual Diagnostics

## 
##  Ljung-Box test
## 
## data:  Residuals from Mean
## Q* = 759.46, df = 23, p-value < 2.2e-16
## 
## Model df: 1.   Total lags used: 24

## 
##  Ljung-Box test
## 
## data:  Residuals from Seasonal naive method
## Q* = 188.33, df = 24, p-value < 2.2e-16
## 
## Model df: 0.   Total lags used: 24

## 
##  Ljung-Box test
## 
## data:  Residuals from Random walk with drift
## Q* = 273.82, df = 23, p-value < 2.2e-16
## 
## Model df: 1.   Total lags used: 24
  • Surprizingly, the residuals show that Naive with Drift captures overall trend as well as some seasonality. The other two methods’ residuals plots show non-zero mean as well as high ACF over lags. Therefore, Naive with Drift may be the best option for this data.

Forecast Accuracy

##                ME     RMSE      MAE      MPE     MAPE      ACF1 Theil's U
## Test set 1.213218 1.751494 1.429603 18.76739 22.11467 0.5334935       Inf
##                 ME      RMSE       MAE      MPE     MAPE       ACF1 Theil's U
## Test set 0.2769231 0.9251473 0.7538462 3.099576 13.97456 -0.3677591 0.5044827
##                ME     RMSE      MAE      MPE     MAPE      ACF1 Theil's U
## Test set 2.730627 3.009716 2.730627 34.19415 34.19415 0.5196436  158.5842
  • Even with residual diagnosics, the forecast accuracy states that Seaonal Naive method has the lowest forecast errors in most of measures. Therefore, we will use seasonal naive as our final basic forecast method.

Forecast with Seasonal Naive

Since we used 39 data points for our test set, we will use h=36, which is about the same size as 39 while including 3 monthly cycle.

##          Point Forecast      Lo 80     Hi 80      Lo 95     Hi 95
## Dec 2019            4.7 2.73188635  6.668114  1.6900299  7.709970
## Jan 2020            5.0 3.03188635  6.968114  1.9900299  8.009970
## Feb 2020            4.2 2.23188635  6.168114  1.1900299  7.209970
## Mar 2020            4.3 2.33188635  6.268114  1.2900299  7.309970
## Apr 2020            3.6 1.63188635  5.568114  0.5900299  6.609970
## May 2020            5.8 3.83188635  7.768114  2.7900299  8.809970
## Jun 2020            5.9 3.93188635  7.868114  2.8900299  8.909970
## Jul 2020            7.6 5.63188635  9.568114  4.5900299 10.609970
## Aug 2020            7.2 5.23188635  9.168114  4.1900299 10.209970
## Sep 2020            6.1 4.13188635  8.068114  3.0900299  9.109970
## Oct 2020            4.4 2.43188635  6.368114  1.3900299  7.409970
## Nov 2020            3.5 1.53188635  5.468114  0.4900299  6.509970
## Dec 2020            4.7 1.91666699  7.483333  0.4432595  8.956741
## Jan 2021            5.0 2.21666699  7.783333  0.7432595  9.256741
## Feb 2021            4.2 1.41666699  6.983333 -0.0567405  8.456741
## Mar 2021            4.3 1.51666699  7.083333  0.0432595  8.556741
## Apr 2021            3.6 0.81666699  6.383333 -0.6567405  7.856741
## May 2021            5.8 3.01666699  8.583333  1.5432595 10.056741
## Jun 2021            5.9 3.11666699  8.683333  1.6432595 10.156741
## Jul 2021            7.6 4.81666699 10.383333  3.3432595 11.856741
## Aug 2021            7.2 4.41666699  9.983333  2.9432595 11.456741
## Sep 2021            6.1 3.31666699  8.883333  1.8432595 10.356741
## Oct 2021            4.4 1.61666699  7.183333  0.1432595  8.656741
## Nov 2021            3.5 0.71666699  6.283333 -0.7567405  7.756741
## Dec 2021            4.7 1.29112717  8.108873 -0.5134211  9.913421
## Jan 2022            5.0 1.59112717  8.408873 -0.2134211 10.213421
## Feb 2022            4.2 0.79112717  7.608873 -1.0134211  9.413421
## Mar 2022            4.3 0.89112717  7.708873 -0.9134211  9.513421
## Apr 2022            3.6 0.19112717  7.008873 -1.6134211  8.813421
## May 2022            5.8 2.39112717  9.208873  0.5865789 11.013421
## Jun 2022            5.9 2.49112717  9.308873  0.6865789 11.113421
## Jul 2022            7.6 4.19112717 11.008873  2.3865789 12.813421
## Aug 2022            7.2 3.79112717 10.608873  1.9865789 12.413421
## Sep 2022            6.1 2.69112717  9.508873  0.8865789 11.313421
## Oct 2022            4.4 0.99112717  7.808873 -0.8134211  9.613421
## Nov 2022            3.5 0.09112717  6.908873 -1.7134211  8.713421
## Warning: Removed 12 row(s) containing missing values (geom_path).

  • Limitation: This method does not take into account (non-monotonous) trend.

c) OLS Regression

OLS Regression for time series requires two components to fit, Trend and Seasonality. For seasonality, we do not need to specify any values (unless Fourier), however we must find approporiate degree of trend. Looking at the overall shape of the time series curve, we can assume that it has some type of polynomial shape. Therefore, we will try 2-5 polynomials and fine the best-performing model by comparing test-training forecasting accuracy. For training/test set splitting, we will use the one from part (b).

Fitting & Plotting

  • From the forecast plots, we can cleaarly see that cubic, quartic, and quintic trends are over-/under-estimating the forecasts.

Forecast Accuracy

##                 ME     RMSE      MAE      MPE     MAPE     ACF1 Theil's U
## Test set 0.9786029 1.179334 1.028599 15.88309 16.79752 0.190932  1.079327
##                 ME     RMSE      MAE      MPE     MAPE      ACF1 Theil's U
## Test set -4.222192 4.874214 4.222192 180.6898 453.9723 0.8718977  6.418366
##                 ME     RMSE      MAE       MPE    MAPE      ACF1 Theil's U
## Test set -9.463041 10.84951 9.463041 -68.94383 418.281 0.9116709  4.629228
##                ME     RMSE      MAE      MPE     MAPE      ACF1 Theil's U
## Test set 4.936267 6.884367 4.986817 37.89307 38.90397 0.8920531  3.093746
  • The quadratic trend model has the lowest forecasting errors in most of the measures. Therefore, we will use quadratic trend OLS forecasting method for our final forecasts.

2-Year Forecasts with Quadratic OLS

## 
## Call:
## tslm(formula = UCG ~ poly(trend, 2) + season)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3.0122 -0.9763  0.0261  0.9059  4.2328 
## 
## Coefficients:
##                 Estimate Std. Error t value Pr(>|t|)    
## (Intercept)       6.4170     0.3216  19.953  < 2e-16 ***
## poly(trend, 2)1   4.4340     1.4393   3.081 0.002323 ** 
## poly(trend, 2)2 -13.9263     1.4386  -9.680  < 2e-16 ***
## season2          -0.2261     0.4547  -0.497 0.619569    
## season3          -1.3017     0.4547  -2.863 0.004598 ** 
## season4          -1.7919     0.4547  -3.941 0.000108 ***
## season5          -0.7417     0.4547  -1.631 0.104281    
## season6           1.4239     0.4548   3.131 0.001972 ** 
## season7           1.8700     0.4548   4.112 5.51e-05 ***
## season8           1.7265     0.4548   3.796 0.000189 ***
## season9           0.5284     0.4548   1.162 0.246616    
## season10         -0.4043     0.4549  -0.889 0.375029    
## season11         -1.4366     0.4549  -3.158 0.001807 ** 
## season12         -1.5206     0.4608  -3.300 0.001125 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.438 on 225 degrees of freedom
## Multiple R-squared:  0.5544, Adjusted R-squared:  0.5287 
## F-statistic: 21.53 on 13 and 225 DF,  p-value: < 2.2e-16
##          Point Forecast     Lo 80    Hi 80       Lo 95    Hi 95
## Dec 2019       3.355504 1.4269910 5.284017  0.39885433 6.312154
## Jan 2020       4.829294 2.9029881 6.755600  1.87602818 7.782560
## Feb 2020       4.555973 2.6286399 6.483307  1.60113219 7.510814
## Mar 2020       3.432653 1.5042663 5.361039  0.47619719 6.389108
## Apr 2020       2.894332 0.9648672 4.823796 -0.06377676 5.852440
## May 2020       3.896011 1.9654428 5.826579  0.93621042 6.855812
## Jun 2020       6.012690 4.0809931 7.944388  3.05115878 8.974222
## Jul 2020       6.409370 4.4765181 8.342221  3.44606840 9.372671
## Aug 2020       6.216049 4.2820179 8.150080  3.25093934 9.181159
## Sep 2020       4.967728 3.0324925 6.902964  2.00077168 7.934685
## Oct 2020       3.984408 2.0479419 5.920873  1.01556548 6.953250
## Nov 2020       2.901087 0.9633663 4.838808 -0.06967918 5.871853
## Dec 2020       2.765541 0.8203951 4.710688 -0.21660919 5.747692
## Jan 2021       4.234253 2.2913678 6.177139  1.25556892 7.212937
## Feb 2021       3.955854 2.0115104 5.900198  0.97493385 6.936775
## Mar 2021       2.827455 0.8816231 4.773288 -0.15574691 5.810658
## Apr 2021       2.284057 0.3367061 4.231407 -0.70147327 5.269586
## May 2021       3.280658 1.3317594 5.229556  0.29275489 6.268561
## Jun 2021       5.392259 3.4417832 7.342735  2.40193767 8.382580
## Jul 2021       5.783860 3.8317774 7.735943  2.79107519 8.776645
## Aug 2021       5.585461 3.6317421 7.539180  2.59016755 8.580755
## Sep 2021       4.332062 2.3766775 6.287447  1.33421487 7.329910
## Oct 2021       3.343663 1.3865836 5.300743  0.34321727 6.344109
## Nov 2021       2.255264 0.2964604 4.214069 -0.74782515 5.258354

  • Limitation: This method does not take into account nonconstant seasonality.

d) STL Decomposition

For STL decomposition, we must input odd numbers for seasonal trend smoother and (optionally) time trend smoother, and both should refer to the number of consecutive years in the data. Since we have 239 data, we have about 19-20 consecutive years. Therefore, let’s fit several values and compare the results of remainder components.

Fitting & Plotting

  • There is not much of difference in their remainder, seasonal, and time trend components. Therefore, let’s stick with default time trend and seasonal trend as 19.

  • Time Trend: There are two peaks around 2004 and 2010.
  • Seasonal Trend: Slight increase in the size of trend around 2010, but overall very similar over time.
  • Remainder: Some sinusoidal patterns over time.

Seasonally Adjusted Time Series

2-Year Forecasts with STL & ETS

For the forecasting method, let’s use naive default ETS.

##          Point Forecast    Lo 80    Hi 80       Lo 95     Hi 95
## Dec 2019       3.776242 2.544987 5.007496  1.89320041  5.659283
## Jan 2020       5.278172 3.973521 6.582824  3.28287979  7.273465
## Feb 2020       5.037923 3.663789 6.412057  2.93636646  7.139480
## Mar 2020       3.742459 2.302191 5.182728  1.53975903  5.945160
## Apr 2020       3.323407 1.819910 4.826903  1.02400748  5.622806
## May 2020       4.391376 2.827206 5.955547  1.99918400  6.783569
## Jun 2020       6.731753 5.109176 8.354331  4.25023523  9.213272
## Jul 2020       7.102866 5.423912 8.781820  4.53512737  9.670604
## Aug 2020       6.872327 5.138830 8.605825  4.22117137  9.523483
## Sep 2020       5.636500 3.850123 7.422877  2.90447222  8.368528
## Oct 2020       4.918589 3.080854 6.756324  2.10801544  7.729163
## Nov 2020       3.577754 1.690057 5.465450  0.69077030  6.464737
## Dec 2020       3.776242 1.839872 5.712611  0.81481977  6.737664
## Jan 2021       5.278172 3.294324 7.262021  2.24413746  8.312207
## Feb 2021       5.037923 3.007705 7.068141  1.93297293  8.142873
## Mar 2021       3.742459 1.666908 5.818011  0.56817767  6.916741
## Apr 2021       3.323407 1.203491 5.443322  0.08127587  6.565537
## May 2021       4.391376 2.228006 6.554746  1.08278759  7.699965
## Jun 2021       6.731753 4.525785 8.937722  3.35801544 10.105491
## Jul 2021       7.102866 4.855105 9.350626  3.66521309 10.540518
## Aug 2021       6.872327 4.583539 9.161116  3.37192689 10.372728
## Sep 2021       5.636500 3.307405 7.965595  2.07445690  9.198543
## Oct 2021       4.918589 2.549874 7.287304  1.29595197  8.541226
## Nov 2021       3.577754 1.170070 5.985437 -0.10448051  7.259988

Forecast Accuracy

Again, let’s use previous test/training set from part (b) for the forecast accuracy calculation. Then, let’s compare results from part (c)

##                  ME      RMSE       MAE        MPE     MAPE       ACF1
## Test set 0.03314763 0.6892201 0.5719824 -0.2831312 11.35006 0.07888046
##          Theil's U
## Test set 0.5823551
##                 ME     RMSE      MAE      MPE     MAPE     ACF1 Theil's U
## Test set 0.9786029 1.179334 1.028599 15.88309 16.79752 0.190932  1.079327
  • STL Decomposition with ETS forecasting method has lower forecast error mearsures. Therefore, STL Decomposition forecasts better than OLS regression.

e) Exponential Smoothing

For exponential smoothing, let’s compare SES, Holt’s Linear Trend, and Holt-Winter’s Seasonal methods by looking at their test/training set accuracy and residual plots. We will explore as many tuning options using test/training set from part (b). For alpha and initial values, we will use training set SSE minizing values (default).

Fitting & Plotting

Note that for SES and Holt’s Linear Trend, they do not capture seasonality. Therefore, let’s use seasonally adjusted time series using STL model in part (e). Note that STL decomposition is additive, therefore we need to add the seasonal components back to the forecasts. Seasonal component’s forecast will be done by ETS. For HW seaonal methods, we will explore all options of damping and seasonality.

  • From the plots, we can see that Holt-Winters’ Additive Seasonality with Damped Trend (green curve) follow along the actual curve well.

Forecast Accuracy & Residual Diagnostics

##                  ME      RMSE       MAE        MPE     MAPE      ACF1 Theil's U
## Test set 0.03338396 0.6892191 0.5720183 -0.2775891 11.35019 0.0788784 0.5824266
##                 ME      RMSE       MAE      MPE     MAPE       ACF1 Theil's U
## Test set 0.1400182 0.7085215 0.5904581 1.802074 11.30344 0.09178412 0.5921647
##                  ME      RMSE       MAE       MPE     MAPE       ACF1 Theil's U
## Test set 0.03951715 0.6896299 0.5724716 -0.153837 11.33504 0.07905486  0.582684
##                 ME      RMSE       MAE      MPE    MAPE       ACF1 Theil's U
## Test set 0.3556708 0.7206685 0.5792596 6.291581 10.6407 0.08458998 0.6797894
##                 ME      RMSE       MAE       MPE     MAPE       ACF1 Theil's U
## Test set -0.103156 0.6254612 0.5149548 -2.616402 10.77612 0.04693611 0.5954174
##                 ME     RMSE       MAE      MPE     MAPE      ACF1 Theil's U
## Test set 0.8405881 1.090129 0.9048738 13.98165 15.11647 0.2274478  1.127999
##                 ME      RMSE       MAE      MPE     MAPE       ACF1 Theil's U
## Test set 0.2982443 0.6754245 0.5313605 5.831943 10.15883 0.08947097 0.7677914
  • Holt-Winters’ Additive Seasonal with Damped Trend has the lowest forecast error measures. This result is consistent what we found in plots.

Now, let’s see if this model’s residuals resemble white noise.

## 
##  Ljung-Box test
## 
## data:  Residuals from Damped Holt-Winters' additive method
## Q* = 43.32, df = 7, p-value = 2.893e-07
## 
## Model df: 17.   Total lags used: 24
  • Residuals have zero mean with slightly non-constant variance, but not so noticeable.

  • Residuals are randomly, normally distributed (no big significant lags).

Therefore, residuals roughly resemble white noise. -> Choose this model.

Forecast with Holt-Winters’ Additive Seasonality with Damped Trend Model

Let’s forecast 3 years ahead.

##          Point Forecast     Lo 80    Hi 80      Lo 95     Hi 95
## Dec 2019       3.640644 2.3578944 4.923394  1.6788478  5.602440
## Jan 2020       5.135469 3.7780393 6.492898  3.0594596  7.211478
## Feb 2020       4.901857 3.4725800 6.331134  2.7159666  7.087747
## Mar 2020       3.827988 2.3293076 5.326668  1.5359543  6.120021
## Apr 2020       3.331390 1.7654440 4.897337  0.9364821  5.726299
## May 2020       4.374279 2.7429562 6.005602  1.8793860  6.869172
## Jun 2020       6.530741 4.8357290 8.225753  3.9384438  9.123038
## Jul 2020       6.965346 5.2081646 8.722528  4.2779689  9.652723
## Aug 2020       6.828705 5.0107331 8.646678  4.0483567  9.609054
## Sep 2020       5.630014 3.7525098 7.507517  2.7586193  8.501408
## Oct 2020       4.680673 2.7447944 6.616551  1.7200022  7.641344
## Nov 2020       3.652502 1.6593175 5.645687  0.6041892  6.700815
## Dec 2020       3.584998 1.5354686 5.634527  0.4505133  6.719483
## Jan 2021       5.081266 2.9763473 7.186185  1.8620705  8.300462
## Feb 2021       4.849061 2.6896167 7.008504  1.5464763  8.151645
## Mar 2021       3.776561 1.5634049 5.989717  0.3918308  7.161292
## Apr 2021       3.281298 1.0151949 5.547401 -0.1844077  6.747004
## May 2021       4.325486 2.0071598 6.643813  0.7799119  7.871061
## Jun 2021       6.483214 4.1133501 8.853078  2.8588199 10.107608
## Jul 2021       6.919052 4.4983028 9.339802  3.2168354 10.621269
## Aug 2021       6.783613 4.3125986 9.254626  3.0045229 10.562702
## Sep 2021       5.586091 3.0654054 8.106776  1.7310352  9.441146
## Oct 2021       4.637890 2.0681004 7.207679  0.7077362  8.568043
## Nov 2021       3.610829 0.9924799 6.229178 -0.3935903  7.615248
## Dec 2021       3.544406 0.8779951 6.210816 -0.5335174  7.622329
## Jan 2022       5.041727 2.3277824 7.755672  0.8911068  9.192347
## Feb 2022       4.810547 2.0495525 7.571542  0.5879703  9.033124
## Mar 2022       3.739047 0.9314698 6.546624 -0.5547717  8.032866
## Apr 2022       3.244757 0.3910492 6.098465 -1.1196126  7.609127
## May 2022       4.289893 1.3904916 7.189295 -0.1443590  8.724146
## Jun 2022       6.448545 3.5038722 9.393217  1.9450568 10.952032
## Jul 2022       6.885282 3.8957497 9.874815  2.3131868 11.457377
## Aug 2022       6.750719 3.7167246 9.784713  2.1106252 11.390812
## Sep 2022       5.554050 2.4759818 8.632118  0.8465509 10.261549
## Oct 2022       4.606680 1.4849143 7.728446 -0.1676488  9.381009
## Nov 2022       3.580429 0.4153324 6.745526 -1.2601687  8.421027

Final Forecasts Graphical Comparisons for Next 2 Years

# Seasonal Naive
UCG.snaive.F <- snaive(UCG, h=24)

# Quadratic OLS
UCG.ols2.F <- forecast(UCG.ols2, h=24)

# STL and ETS
UCG.stl1.F <- stlf(UCG, s.window = 19, robust = TRUE, h = 24)

# Holt-Winters' Additive Seasonality with Damped Trend
UCG.hw.F <- hw(UCG, seasonal = "additive", damped = TRUE, h=24)

# Plot
autoplot(UCG, xlab = "Year", ylab = "Unemployment Rate", main = "UCG Forecasting Full Graph") +
  autolayer(UCG.snaive.F$mean, series = "Seasonal Naive") +
  autolayer(UCG.ols2.F$mean, series = "Quadratic OLS") +
  autolayer(UCG.stl1.F$mean, series = "STL ETS") +
  autolayer(UCG.hw.F$mean, series = "HW Add/Damped") +
  guides(color = guide_legend(title = "Forecast Method"))

autoplot(tail(UCG, 120), xlab = "Year", ylab = "Unemployment Rate", main = "UCG Forecasting - Past 10 Years") +
  autolayer(UCG.snaive.F$mean, series = "Seasonal Naive") +
  autolayer(UCG.ols2.F$mean, series = "Quadratic OLS") +
  autolayer(UCG.stl1.F$mean, series = "STL ETS") +
  autolayer(UCG.hw.F$mean, series = "HW Add/Damped") +
  guides(color = guide_legend(title = "Forecast Method"))

  • From the graphs, STL ETS and HW Add/Damped Models may be the most accurate.

2. Personal Saving Rate

Data Description

## [1] 730

a) Preliminary Graphs and Analysis

## [1] 1.209613
  • Trend: Polynomial overall trend. Peak around 1975 and trough around 2005.

  • Seasonality: Sine the data is seasonally adjusted, we expect no seasonality. The seasonal plots show that there isn’t much strong seasonality. Although, the lag plots and ACf plot show that there is strong autocorrelation.

  • Transformation: From the original time series plot, it does not seem to have issues with constant variance expect a few spikes. These do not get solved through transformation in Box-Cox transformed plots, therefore we will not consider transformation. However, if we observe any issues in residuals plots in any forecasts, we may consider transformating.

b) Basic Forecasting

To determine which basic forecasting method performs the best, we will split the data into training and test set and test which method gives the lowest accuracy error measures, as well as checking residuals. Before starting this process, let’s see if there is any methods that may not be important to even consider.

  • Naive: As you may have noticed in the time series plot, this data is not non-stationary, therefore most recent data point may not represent the future forecasts well. But, let’s still compare the results with other forecasting methods.

  • Average: This may perform better than any other methods since the data has overall cyclical trend not exactly increasing or decreasing.

  • Seasonal Naive: This will not perform any better than Naive since the data is already seasonally adjusted. Therefore, we will not consider this method.

  • Naive with Drift: This will be affected by the variation of the endpoints, so it will not be accurate. However, we will still compare the result.

Test/Training Set

Since the length of our data set is 730, we will split them into 600 and 130 (about 20% of training set).

Fitting & Plotting

  • Average: fails to account for low value of the most recent data, thus overestimates.

  • Naive: visually closest to the actuals since it captures the low value of the most recent data.

  • Drift: fails to capture the recent increasing trend, therefore underestimates.

From the plots, we can say that Naive method performs the best.

Residual Diagnostics

## 
##  Ljung-Box test
## 
## data:  Residuals from Naive method
## Q* = 72.413, df = 24, p-value = 9.37e-07
## 
## Model df: 0.   Total lags used: 24

## 
##  Ljung-Box test
## 
## data:  Residuals from Mean
## Q* = 11463, df = 23, p-value < 2.2e-16
## 
## Model df: 1.   Total lags used: 24

## 
##  Ljung-Box test
## 
## data:  Residuals from Random walk with drift
## Q* = 72.413, df = 23, p-value = 5.129e-07
## 
## Model df: 1.   Total lags used: 24
  • Residuals of Naive method and Naive with Drift method seem to have the same result that residuals have zero mean with constant variance, normal distribution, and relatively low autocorrelation. Residuals from average method do not have any of these properties.

Forecast Accuracy

##                  ME     RMSE       MAE       MPE     MAPE      ACF1 Theil's U
## Test set -0.8123077 1.218574 0.9553846 -12.69231 14.92788 0.7099106       Inf
##                ME     RMSE      MAE      MPE     MAPE      ACF1 Theil's U
## Test set 1.962859 2.162844 2.014392 21.39317 21.95483 0.7099106       Inf
##                 ME     RMSE      MAE       MPE     MAPE      ACF1 Theil's U
## Test set -1.348117 1.708536 1.456038 -23.58936 25.29808 0.7747826  214.0008
  • As expected from plots, Naive method has the lowest forecast error measures. Therefore, we will forecast with Naive method for basic forecasting.

Forecast with Naive

Since we used 130 data points for our test set, we will use h=100 for simplicity..

##          Point Forecast        Lo 80     Hi 80       Lo 95     Hi 95
## Nov 2019            7.8  6.893669471  8.706331  6.41388707  9.186113
## Dec 2019            7.8  6.518255074  9.081745  5.83974030  9.760260
## Jan 2020            7.8  6.230189475  9.369811  5.39918198 10.200818
## Feb 2020            7.8  5.987338942  9.612661  5.02777414 10.572226
## Mar 2020            7.8  5.773383327  9.826617  4.70055726 10.899443
## Apr 2020            7.8  5.579952665 10.020047  4.40473060 11.195269
## May 2020            7.8  5.402074814 10.197925  4.13268990 11.467310
## Jun 2020            7.8  5.236510147 10.363490  3.87948059 11.720519
## Jul 2020            7.8  5.081008412 10.518992  3.64166121 11.958339
## Aug 2020            7.8  4.933931215 10.666069  3.41672605 12.183274
## Sep 2020            7.8  4.794041699 10.805958  3.20278349 12.397217
## Oct 2020            7.8  4.660378950 10.939621  2.99836396 12.601636
## Nov 2020            7.8  4.532178805 11.067821  2.80229876 12.797701
## Dec 2020            7.8  4.408821681 11.191178  2.61364032 12.986360
## Jan 2021            7.8  4.289796954 11.310203  2.43160771 13.168392
## Feb 2021            7.8  4.174677883 11.425322  2.25554828 13.344452
## Mar 2021            7.8  4.063103496 11.536897  2.08490998 13.515090
## Apr 2021            7.8  3.954765221 11.645235  1.91922089 13.680779
## May 2021            7.8  3.849396814 11.750603  1.75807381 13.841926
## Jun 2021            7.8  3.746766653 11.853233  1.60111453 13.998885
## Jul 2021            7.8  3.646671745 11.953328  1.44803258 14.151967
## Aug 2021            7.8  3.548933002 12.051067  1.29855407 14.301446
## Sep 2021            7.8  3.453391478 12.146609  1.15243592 14.447564
## Oct 2021            7.8  3.359905330 12.240095  1.00946119 14.590539
## Nov 2021            7.8  3.268347354 12.331653  0.86943535 14.730565
## Dec 2021            7.8  3.178602946 12.421397  0.73218312 14.867817
## Jan 2022            7.8  3.090568425 12.509432  0.59754594 15.002454
## Feb 2022            7.8  3.004149628 12.595850  0.46537980 15.134620
## Mar 2022            7.8  2.919260731 12.680739  0.33555343 15.264447
## Apr 2022            7.8  2.835823246 12.764177  0.20794681 15.392053
## May 2022            7.8  2.753765179 12.846235  0.08244983 15.517550
## Jun 2022            7.8  2.673020295 12.926980 -0.04103882 15.641039
## Jul 2022            7.8  2.593527497 13.006473 -0.16261256 15.762613
## Aug 2022            7.8  2.515230283 13.084770 -0.28235781 15.882358
## Sep 2022            7.8  2.438076279 13.161924 -0.40035468 16.000355
## Oct 2022            7.8  2.362016825 13.237983 -0.51667758 16.116678
## Nov 2022            7.8  2.287006617 13.312993 -0.63139579 16.231396
## Dec 2022            7.8  2.213003395 13.386997 -0.74457395 16.344574
## Jan 2023            7.8  2.139967659 13.460032 -0.85627247 16.456272
## Feb 2023            7.8  2.067862430 13.532138 -0.96654791 16.566548
## Mar 2023            7.8  1.996653021 13.603347 -1.07545330 16.675453
## Apr 2023            7.8  1.926306853 13.673693 -1.18303848 16.783038
## May 2023            7.8  1.856793272 13.743207 -1.28935033 16.889350
## Jun 2023            7.8  1.788083397 13.811917 -1.39443301 16.994433
## Jul 2023            7.8  1.720149980 13.879850 -1.49832821 17.098328
## Aug 2023            7.8  1.652967277 13.947033 -1.60107528 17.201075
## Sep 2023            7.8  1.586510938 14.013489 -1.70271148 17.302711
## Oct 2023            7.8  1.520757900 14.079242 -1.80327208 17.403272
## Nov 2023            7.8  1.455686296 14.144314 -1.90279051 17.502791
## Dec 2023            7.8  1.391275368 14.208725 -2.00129852 17.601299
## Jan 2024            7.8  1.327505393 14.272495 -2.09882628 17.698826
## Feb 2024            7.8  1.264357609 14.335642 -2.19540248 17.795402
## Mar 2024            7.8  1.201814152 14.398186 -2.29105445 17.891054
## Apr 2024            7.8  1.139857996 14.460142 -2.38580821 17.985808
## May 2024            7.8  1.078472901 14.521527 -2.47968861 18.079689
## Jun 2024            7.8  1.017643361 14.582357 -2.57271937 18.172719
## Jul 2024            7.8  0.957354561 14.642645 -2.66492313 18.264923
## Aug 2024            7.8  0.897592331 14.702408 -2.75632157 18.356322
## Sep 2024            7.8  0.838343110 14.761657 -2.84693544 18.446935
## Oct 2024            7.8  0.779593909 14.820406 -2.93678459 18.536785
## Nov 2024            7.8  0.721332278 14.878668 -3.02588806 18.625888
## Dec 2024            7.8  0.663546277 14.936454 -3.11426412 18.714264
## Jan 2025            7.8  0.606224442 14.993776 -3.20193030 18.801930
## Feb 2025            7.8  0.549355767 15.050644 -3.28890344 18.888903
## Mar 2025            7.8  0.492929669 15.107070 -3.37519971 18.975200
## Apr 2025            7.8  0.436935974 15.163064 -3.46083468 19.060835
## May 2025            7.8  0.381364891 15.218635 -3.54582331 19.145823
## Jun 2025            7.8  0.326206993 15.273793 -3.63018004 19.230180
## Jul 2025            7.8  0.271453199 15.328547 -3.71391874 19.313919
## Aug 2025            7.8  0.217094754 15.382905 -3.79705281 19.397053
## Sep 2025            7.8  0.163123217 15.436877 -3.87959515 19.479595
## Oct 2025            7.8  0.109530442 15.490470 -3.96155823 19.561558
## Nov 2025            7.8  0.056308564 15.543691 -4.04295406 19.642954
## Dec 2025            7.8  0.003449989 15.596550 -4.12379428 19.723794
## Jan 2026            7.8 -0.049052625 15.649053 -4.20409010 19.804090
## Feb 2026            7.8 -0.101206372 15.701206 -4.28385237 19.883852
## Mar 2026            7.8 -0.153018117 15.753018 -4.36309160 19.963092
## Apr 2026            7.8 -0.204494500 15.804494 -4.44181793 20.041818
## May 2026            7.8 -0.255641950 15.855642 -4.52004120 20.120041
## Jun 2026            7.8 -0.306466693 15.906467 -4.59777094 20.197771
## Jul 2026            7.8 -0.356974763 15.956975 -4.67501637 20.275016
## Aug 2026            7.8 -0.407172004 16.007172 -4.75178642 20.351786
## Sep 2026            7.8 -0.457064087 16.057064 -4.82808978 20.428090
## Oct 2026            7.8 -0.506656509 16.106657 -4.90393485 20.503935
## Nov 2026            7.8 -0.555954607 16.155955 -4.97932978 20.579330
## Dec 2026            7.8 -0.604963558 16.204964 -5.05428250 20.654283
## Jan 2027            7.8 -0.653688393 16.253688 -5.12880071 20.728801
## Feb 2027            7.8 -0.702133995 16.302134 -5.20289186 20.802892
## Mar 2027            7.8 -0.750305112 16.350305 -5.27656323 20.876563
## Apr 2027            7.8 -0.798206356 16.398206 -5.34982186 20.949822
## May 2027            7.8 -0.845842212 16.445842 -5.42267461 21.022675
## Jun 2027            7.8 -0.893217045 16.493217 -5.49512817 21.095128
## Jul 2027            7.8 -0.940335097 16.540335 -5.56718901 21.167189
## Aug 2027            7.8 -0.987200501 16.587201 -5.63886346 21.238863
## Sep 2027            7.8 -1.033817276 16.633817 -5.71015767 21.310158
## Oct 2027            7.8 -1.080189339 16.680189 -5.78107762 21.381078
## Nov 2027            7.8 -1.126320503 16.726321 -5.85162914 21.451629
## Dec 2027            7.8 -1.172214485 16.772214 -5.92181793 21.521818
## Jan 2028            7.8 -1.217874904 16.817875 -5.99164952 21.591650
## Feb 2028            7.8 -1.263305292 16.863305 -6.06112930 21.661129
## Warning: Removed 1 row(s) containing missing values (geom_path).

  • Limitation: This method does not take into account (non-monotonous) trend.

e) Exponential Smoothing

For exponential smoothing, let’s compare SES and Holt’s Linear Trend methods by looking at their test/training set accuracy and residual plots. We will explore as many tuning options using test/training set from part (b). Note that Holw-Winters’ Method will not be used since the data is already seasonally adjusted.

Fitting & Plotting

Since we do not include Holt-Winters’ Method, let’s explore more of different parameter settings. For damped Holt’s Linear trend, initial value is required to be optimal, we will use default values.

  • By eliminating methods with large erros (Holt Non-Damped 0.3, 0.6, 0.9), let’see other methods more closely.

  • From the plots, we can see that all methods besides SES 0.3 and Holt Non-Damped Default performs similarly. Therefore, let’s compare these methods in forecast accuracy. However, note that all of them are flat forecasts, which may not be so meaningful.

Forecast Accuracy & Residual Diagnostics

##                ME     RMSE      MAE       MPE     MAPE      ACF1 Theil's U
## Test set -1.05173 1.389681 1.134614 -17.07193 18.41734 0.7099106       Inf
##                 ME     RMSE      MAE       MPE     MAPE      ACF1 Theil's U
## Test set -1.018866 1.364979 1.108324 -16.45073 17.89512 0.7099106       Inf
##                  ME     RMSE       MAE       MPE     MAPE      ACF1 Theil's U
## Test set -0.8221904 1.225184 0.9623785 -12.86659 15.06042 0.7099106       Inf
##                 ME     RMSE      MAE       MPE    MAPE      ACF1 Theil's U
## Test set -1.053274 1.390831 1.135827 -17.10121 18.4416 0.7098978  66068.28
  • SES with alpha = 0.9 has the lowest forecast error measures.

Now, let’s see if this model’s residuals resemble white noise.

## 
##  Ljung-Box test
## 
## data:  Residuals from Simple exponential smoothing
## Q* = 60.746, df = 22, p-value = 1.732e-05
## 
## Model df: 2.   Total lags used: 24
  • Residuals have zero mean and constant variance except a handful of spikes, which can be ignored.

  • Residuals are randomly, normally distributed (no big significant lags after 3 lags).

Therefore, residuals roughly resemble white noise. -> Choose this model.

Forecast with SES with alpha = 0.9 Model

Since we chose h=100 in the basic forecasting, let’s forecast 100 steps ahead again.

##          Point Forecast       Lo 80     Hi 80       Lo 95     Hi 95
## Nov 2019        7.82862  6.94017522  8.717065  6.46986084  9.187380
## Dec 2019        7.82862  6.63333972  9.023901  6.00059643  9.656644
## Jan 2020        7.82862  6.39054635  9.266694  5.62927601 10.027964
## Feb 2020        7.82862  6.18319704  9.474043  5.31216261 10.345078
## Mar 2020        7.82862  5.99919998  9.658041  5.03076339 10.626477
## Apr 2020        7.82862  5.83208838  9.825152  4.77518825 10.882052
## May 2020        7.82862  5.67792257  9.979318  4.53941200 11.117828
## Jun 2020        7.82862  5.53409165 10.123149  4.31944158 11.337799
## Jul 2020        7.82862  5.39875966 10.258481  4.11246917 11.544771
## Aug 2020        7.82862  5.27057735 10.386663  3.91643124 11.740809
## Sep 2020        7.82862  5.14851867 10.508722  3.72975860 11.927482
## Oct 2020        7.82862  5.03178178 10.625459  3.55122492 12.106016
## Nov 2020        7.82862  4.91972588 10.737515  3.37985022 12.277390
## Dec 2020        7.82862  4.81182933 10.845411  3.21483669 12.442404
## Jan 2021        7.82862  4.70766071 10.949580  3.05552454 12.601716
## Feb 2021        7.82862  4.60685840 11.050382  2.90136070 12.755880
## Mar 2021        7.82862  4.50911571 11.148125  2.75187615 12.905364
## Apr 2021        7.82862  4.41416987 11.243071  2.60666903 13.050571
## May 2021        7.82862  4.32179371 11.335447  2.46539188 13.191849
## Jun 2021        7.82862  4.23178923 11.425451  2.32774191 13.329499
## Jul 2021        7.82862  4.14398263 11.513258  2.19345331 13.463787
## Aug 2021        7.82862  4.05822036 11.599020  2.06229122 13.594949
## Sep 2021        7.82862  3.97436593 11.682875  1.93404695 13.723194
## Oct 2021        7.82862  3.89229743 11.764943  1.80853401 13.848706
## Nov 2021        7.82862  3.81190538 11.845335  1.68558498 13.971656
## Dec 2021        7.82862  3.73309107 11.924149  1.56504888 14.092192
## Jan 2022        7.82862  3.65576508 12.001475  1.44678899 14.210452
## Feb 2022        7.82862  3.57984616 12.077394  1.33068102 14.326559
## Mar 2022        7.82862  3.50526018 12.151980  1.21661161 14.440629
## Apr 2022        7.82862  3.43193931 12.225301  1.10447702 14.552763
## May 2022        7.82862  3.35982128 12.297419  0.99418200 14.663058
## Jun 2022        7.82862  3.28884875 12.368392  0.88563889 14.771602
## Jul 2022        7.82862  3.21896883 12.438272  0.77876677 14.878474
## Aug 2022        7.82862  3.15013254 12.507108  0.67349076 14.983750
## Sep 2022        7.82862  3.08229449 12.574946  0.56974141 15.087499
## Oct 2022        7.82862  3.01541246 12.641828  0.46745418 15.189786
## Nov 2022        7.82862  2.94944715 12.707793  0.36656893 15.290672
## Dec 2022        7.82862  2.88436185 12.772879  0.26702955 15.390211
## Jan 2023        7.82862  2.82012226 12.837118  0.16878358 15.488457
## Feb 2023        7.82862  2.75669624 12.900544  0.07178186 15.585459
## Mar 2023        7.82862  2.69405365 12.963187 -0.02402171 15.681262
## Apr 2023        7.82862  2.63216616 13.025074 -0.11867047 15.775911
## May 2023        7.82862  2.57100709 13.086233 -0.21220519 15.869446
## Jun 2023        7.82862  2.51055132 13.146689 -0.30466431 15.961905
## Jul 2023        7.82862  2.45077513 13.206465 -0.39608410 16.053325
## Aug 2023        7.82862  2.39165611 13.265584 -0.48649885 16.143739
## Sep 2023        7.82862  2.33317304 13.324067 -0.57594099 16.233181
## Oct 2023        7.82862  2.27530583 13.381935 -0.66444124 16.321682
## Nov 2023        7.82862  2.21803543 13.439205 -0.75202876 16.409269
## Dec 2023        7.82862  2.16134374 13.495897 -0.83873122 16.495972
## Jan 2024        7.82862  2.10521357 13.552027 -0.92457491 16.581815
## Feb 2024        7.82862  2.04962856 13.607612 -1.00958485 16.666825
## Mar 2024        7.82862  1.99457311 13.662667 -1.09378488 16.751025
## Apr 2024        7.82862  1.94003239 13.717208 -1.17719772 16.834438
## May 2024        7.82862  1.88599221 13.771248 -1.25984504 16.917086
## Jun 2024        7.82862  1.83243905 13.824801 -1.34174753 16.998988
## Jul 2024        7.82862  1.77935997 13.877881 -1.42292498 17.080165
## Aug 2024        7.82862  1.72674259 13.930498 -1.50339632 17.160637
## Sep 2024        7.82862  1.67457508 13.982665 -1.58317964 17.240420
## Oct 2024        7.82862  1.62284609 14.034394 -1.66229231 17.319533
## Nov 2024        7.82862  1.57154474 14.085696 -1.74075095 17.397991
## Dec 2024        7.82862  1.52066060 14.136580 -1.81857152 17.475812
## Jan 2025        7.82862  1.47018366 14.187057 -1.89576935 17.553010
## Feb 2025        7.82862  1.42010429 14.237136 -1.97235914 17.629600
## Mar 2025        7.82862  1.37041323 14.286827 -2.04835504 17.705596
## Apr 2025        7.82862  1.32110161 14.336139 -2.12377066 17.781011
## May 2025        7.82862  1.27216085 14.385080 -2.19861910 17.855860
## Jun 2025        7.82862  1.22358272 14.433658 -2.27291294 17.930153
## Jul 2025        7.82862  1.17535926 14.481881 -2.34666436 18.003905
## Aug 2025        7.82862  1.12748282 14.529758 -2.41988504 18.077126
## Sep 2025        7.82862  1.07994603 14.577294 -2.49258630 18.149827
## Oct 2025        7.82862  1.03274174 14.624499 -2.56477904 18.222020
## Nov 2025        7.82862  0.98586307 14.671377 -2.63647376 18.293714
## Dec 2025        7.82862  0.93930339 14.717937 -2.70768065 18.364921
## Jan 2026        7.82862  0.89305627 14.764184 -2.77840952 18.435650
## Feb 2026        7.82862  0.84711549 14.810125 -2.84866988 18.505910
## Mar 2026        7.82862  0.80147505 14.855765 -2.91847092 18.575711
## Apr 2026        7.82862  0.75612913 14.901111 -2.98782152 18.645062
## May 2026        7.82862  0.71107210 14.946168 -3.05673029 18.713971
## Jun 2026        7.82862  0.66629851 14.990942 -3.12520559 18.782446
## Jul 2026        7.82862  0.62180308 15.035437 -3.19325547 18.850496
## Aug 2026        7.82862  0.57758069 15.079660 -3.26088778 18.918128
## Sep 2026        7.82862  0.53362637 15.123614 -3.32811011 18.985351
## Oct 2026        7.82862  0.48993531 15.167305 -3.39492983 19.052170
## Nov 2026        7.82862  0.44650283 15.210738 -3.46135407 19.118595
## Dec 2026        7.82862  0.40332439 15.253916 -3.52738980 19.184630
## Jan 2027        7.82862  0.36039559 15.296845 -3.59304374 19.250284
## Feb 2027        7.82862  0.31771214 15.339528 -3.65832243 19.315563
## Mar 2027        7.82862  0.27526990 15.381971 -3.72323225 19.380473
## Apr 2027        7.82862  0.23306480 15.424176 -3.78777937 19.445020
## May 2027        7.82862  0.19109293 15.466148 -3.85196981 19.509210
## Jun 2027        7.82862  0.14935046 15.507890 -3.91580941 19.573050
## Jul 2027        7.82862  0.10783366 15.549407 -3.97930387 19.636544
## Aug 2027        7.82862  0.06653892 15.590702 -4.04245872 19.699699
## Sep 2027        7.82862  0.02546272 15.631778 -4.10527936 19.762520
## Oct 2027        7.82862 -0.01539839 15.672639 -4.16777104 19.825012
## Nov 2027        7.82862 -0.05604775 15.713288 -4.22993886 19.887179
## Dec 2027        7.82862 -0.09648861 15.753729 -4.29178782 19.949028
## Jan 2028        7.82862 -0.13672415 15.793965 -4.35332277 20.010563
## Feb 2028        7.82862 -0.17675747 15.833998 -4.41454845 20.071789

  • This model returns flat forecasts. However, no other model considered above could predict the trend well. Therefore, these are our best estimates.

Final Forecasts Graphical Comparisons for Next 3 Years

# Naive
PSR.naive.F <- naive(PSR, h=36)

# SES with alpha = 0.9
PSR.ses.F <- ses(PSR, alpha = 0.9, initial = "simple", h = 36)

# Plot
autoplot(PSR, xlab = "Year", ylab = "Saving Rate", main = "PSR Forecasting Full Graph") +
  autolayer(PSR.naive.F$mean, series = "Naive") +
  autolayer(PSR.ses.F$mean, series = "SES") +
  guides(color = guide_legend(title = "Forecast Method"))

autoplot(tail(PSR, 120), xlab = "Year", ylab = "Saving Rate", main = "PSR Forecasting - Past 10 Years") +
  autolayer(PSR.naive.F$mean, series = "Naive") +
  autolayer(PSR.ses.F$mean, series = "SES") +
  guides(color = guide_legend(title = "Forecast Method"))

  • From the graphs, we can see that both methods return flat forecasts. Therefore, we need different forecasting models.