Exploring forecast
Posted onTime series forecasting is interesting. I want to write more, but not right now. I’m just going to lay out a few functions for explanation later.
I am going to test a few different methods:
-
Mean forecasting
-
Random Walk (last value is forecast with an addition)
-
Seasonal Naive (last seasons value is next guess)
-
Naive (Previous value is forecast)
beer2 <-
beer_fit1 <-
beer_fit2 <-
beer_fit3 <-
beer_fit4 <-
Let’s see how we did on the forecast.
beer3 <-
models <-
$mean_forecast
ME RMSE MAE MPE MAPE MASE ACF1
Training set 0.000 43.62858 35.23438 -0.9365102 7.886776 2.463942 -0.10915105
Test set -13.775 38.44724 34.82500 -3.9698659 8.283390 2.435315 -0.06905715
Theil's U
Training set NA
Test set 0.801254
$rand_walk
ME RMSE MAE MPE MAPE MASE
Training set 0.4761905 65.31511 54.73016 -0.9162496 12.16415 3.827284
Test set -51.4000000 62.69290 57.40000 -12.9549160 14.18442 4.013986
ACF1 Theil's U
Training set -0.24098292 NA
Test set -0.06905715 1.254009
$seasonal_naive
ME RMSE MAE MPE MAPE MASE ACF1
Training set -2.133333 16.78193 14.3 -0.5537713 3.313685 1.0000000 -0.2876333
Test set 5.200000 14.31084 13.4 1.1475536 3.168503 0.9370629 0.1318407
Theil's U
Training set NA
Test set 0.298728
$naive
ME RMSE MAE MPE MAPE MASE
Training set 0.4761905 65.31511 54.73016 -0.9162496 12.16415 3.827284
Test set -51.4000000 62.69290 57.40000 -12.9549160 14.18442 4.013986
ACF1 Theil's U
Training set -0.24098292 NA
Test set -0.06905715 1.254009
Seasonal Naive looks like it won!
Citation
BibTex citation:
@online{dewitt2018
author = {Michael E. DeWitt},
title = {Exploring forecast},
date = 2018-07-07,
url = {https://michaeldewittjr.com/articles/2018-07-08-exploring-forecast},
langid = {en}
}
For attribution, please cite this work as:
Michael E. DeWitt. 2018. "Exploring forecast." July 7, 2018. https://michaeldewittjr.com/articles/2018-07-08-exploring-forecast