I am trying to fit a dynamic regression model using auto.arima. I have monthly data for gas (for heating) use per customer (which I want to predict) and set of regressors (e.g. heating degree days, gas price, structural dummies for particular years and seasonal dummies). I have forecast values for the exogenous regressors. Use per customer data is available from Jan 2005- Mar2018, all other data is from Jan2005-Dec 2021. I am trying to forecast Use Per Customer for all months of the year 2020. I am unsure how to divide my data between xreg in the auto.arima function and the forecast function. The forecast values I am currently yielding do not match up with the month of use, for example, April 2018 forecast for use per customer is as high as and almost equal to Jan 2005 actual use. This should not be the case.
I am trying to forecast gas usage for residential customers using a dynamic regression model in the forecats package. I have referred to the online textbook by Prof. Rob J. Hyndman https://otexts.com/fpp2/forecasting.html
#I generated the time series for the period for which the data is available (Jan 2005-Mar 2018)
Med_ros_upc.ts.test<-ts(Med_ros_upc.ts[,"ORMEDSCH410upc.r"],
frequency = 12, start = c(2005,1), end = c(2018,3))
#This is the set of external regressors including seasonal dummies(sd.ts)
xreg_Med<- cbind(Hdd = Med_ros_upc.ts[, "MEDHDD"],
Hdd2 = Med_ros_upc.ts[, "MEDHDD2"],
RPA = Med_ros_upc.ts[, "ORSCH410RPAt1.r"], sd,
Jan2009, intdummf)
#I convert the xreg matrix into a time series. I use this in auto.arima
xreg_Med.ts<-ts(xreg_Med, frequency = 12, start = c(2005,1),
end = c(2018,3))
#I generate a different xreg for forecast"
xreg_Med.ts1<-ts(xreg_Med, frequency = 12, start = c(2018,4),
end = c(2021, 12))
fitdyn <- auto.arima(Med_ros_upc.ts.test, xreg =xreg_Med.ts)
fcast <- forecast(fitdyn , xreg = xreg_Med.ts1)
Expected result
Point forecast
Jan 2005 111.19
Feb 2005 89.22...
April 2005 53.86
Actual result Point forecast
April 2018 111.19 May 2018 89.22... Jun 2018 53.86