I'm trying to fit a model to my data set using the auto.arima function but I get an error message of no suitable ARIMA model found which I suspect can be attributed to what I'm passing for the xreg portion. My data set contains 1176 total observation, including 1 variable I'm trying to forecast and the rest being dummy variables (holidays, days of the week, etc.) which I'm trying to pass into auto.arima as regressors.
library(forecast)
data <- read.csv(...)
#extract variable to be forecasted and extract regressors
forcast.var <- data[, 29]
regressors <- data[, 2:27]
#split forecast variable and regressors into train and test sets
train.r <- regressors[1:1000, ]
test.r <- regressors[1001:1176, ]
train.f <- forecast.var[1:1000]
test.f <- forecast.var[1001:1176]
#fit the data, pass 'train.r' into data.matrix and into 'xreg' since
#documentation for this function says it must be a vector or matrix
fit <- auto.arima(train.f, stepwise = FALSE, approximation = FALSE
, xreg = data.matrix(train.r))
If I attempt to run this, I get the aforementioned error message. I do get a fitted model if I don't pass anything for xreg, but the fitted values or nowhere near close to the actuals. I should mention that train.r does already have column names. So what is it that I'm doing wrong? How do I successfully pass the regressors in hopes that my model comes out more accurate?
train.r. - erik7970