—————————————————————————
Student Name : Sachid Deshmukh
—————————————————————————
3.8 For your retail time series (from Exercise 3 in Section 2.10):
a. Split the data into two parts using:
myts.train <- window(myts, end=c(2010,12))
myts.test <- window(myts, start=2011)
b. Check that your data have been split appropriately by producing the following plot.
autoplot(myts) +
autolayer(myts.train, series="Train") +
autolayer(myts.test, series="Test")

c. Calculate forecasts using snaive applied to myts.train.
fc <- snaive(myts.train)
d. Compare the accuracy of your forecasts against the actual values stored in myts.test.
accuracy(fc,myts.test)
## ME RMSE MAE MPE MAPE MASE
## Training set 6.870871 12.27525 8.893093 5.476112 7.780981 1.00000
## Test set 28.400000 29.39091 28.400000 11.015822 11.015822 3.19349
## ACF1 Theil's U
## Training set 0.6617306 NA
## Test set 0.5697915 0.7493485
e. Check the residuals.
checkresiduals(fc)

##
## Ljung-Box test
##
## data: Residuals from Seasonal naive method
## Q* = 591.71, df = 24, p-value < 2.2e-16
##
## Model df: 0. Total lags used: 24
f. How sensitive are the accuracy measures to the training/test split?
We can see that root mean square value with cross validation is 12.60 and root mean square value obtained using train test split is 29.39. Huge RMSE difference between cross validation and train test split approach indicates that accuracy measure of the above time series is vary sensitive to training/test split