Hello,
I wanted to check the forecast data by using training and test method using random walk with drift method. however i received an error
###########Splitting data into training and test data sets############
TS_Train <- window(FCL_forecasttimeseries, start=c(2012,14), end=c(2017,24), freq=24)
TS_Test <- window(FCL_forecasttimeseries, start=c(2018,1), freq=24)
TS_Train
TS_Test
autoplot(TS_Train, series = "Train")+ autolayer(TS_Test, series = "Test") + ggtitle("FCL rates Training & Test data") + xlab("periods")+ylab("Rates")+ guides(colour=guide_legend(title = "Forecast"))
############forecasting MAEHODS ############
###########R1.Random walk with drift forecasting (using Log value) for Test & Training data#########
fit_decomposelog <- stl(log10(TS_Train), s.window = "p")
fit_decomposelog
TS_Train_stl <- forecast(fit_decomposelog, method = "rwdrift", h=36) ##### (h=36)No. of periods that you want to forecast######
plot(TS_Train_stl)
TS_Train_stl
########Accuracy measures: RMSE and MAPE using RWD#########
vec2 <- 10^(cbind(log10(TS_Test), as.data.frame(forecast(fit_decomposelog, method = "rwdrift", h=36)[,1])))
the error states:
Error in forecast(fit_decomposelog, method = "rwdrift", h = 36)[, 1] :
incorrect number of dimensions
Can you please help me with this
thank you
Sachin