Known data, 4 years of daily energy consumption correlated with temperature, seasonal calendar and holidays.
Required forecasting for next days depending on known variables like temperature and holidays.
My approach is:
trainCD <- read.table("TrainCD.csv", sep=";",dec=",", header = TRUE) #(variables :Year;Month;Day;CD;Temperature;Holiday) // CD= Consumption prevCD<-auto.arima(ts(trainCD$CD,frequency =365),d=1,D=1,xreg=trainCD$Temp) #where trainCD$Temp represents history of daily temperatures ProgCD <- forecast(prevCD,xreg = temper$Tprog) #forecast using future temperatures from external system
The daily forecast is OK, it gives good results; but I would like also to improve it by adding the holiday variable, on the history and on the future variables.
My question is: Can I use something like this?
prevCD7 <- auto.arima(ts(trainCD$CD,frequency=365),d=1,D=1, xreg=cbind(trainCD$Temp,trainCD$Holiday)) ProgCD7 <- forecast(prevCD7, xreg=cbind(temper$Tprog,temper$Holiday2))