I am learning forecasting myself and created this sample algorithm
library(e1071)
library(forecast)
library(xts)
set.seed(3)
Ex <- xts(1:100, Sys.Date()+1:100)
data = data.frame(Ex,matrix(rnorm(100*2,mean=123,sd=3), nrow=100))
accu<-list()
ama=auto.arima(data$X1)
et=ets(data$X1)
rw=rwf(data$X1)
nvw=naive(data$X1)
mn=meanf(data$X1)
models = list(ama,et,rw,nvw,mn)
# 30 day forecast with 75%,85%,95%,97%, and 99% confidence bands
layout(matrix(1:6,nr=3))
for(i in 1:length(models)) {
fc<- forecast(models[[i]], 30, level = c(75,85,95,97,99))
accu[[i]]<-accuracy(fc)
plot(fc, main = names(models)[[i]])
}
accu
but whatever model I chose I am getting a flat and similar values for all my models. I have expected some kind of change in my forecasting values.
E.g:
Point Forecast Lo 80 Hi 80 Lo 95 Hi 95
1 123.0331 119.7031 126.3631 117.9118 128.1544
2 123.0331 119.7031 126.3631 117.9118 128.1544
3 123.0331 119.7031 126.3631 117.9118 128.1544
4 123.0331 119.7031 126.3631 117.9118 128.1544
5 123.0331 119.7031 126.3631 117.9118 128.1544
Where am I making the mistake?
Also a small coding question, How can I change X axis from number of days to the Date (2016-04-1)?