My dataset contains the following information aggregated into 5-minute intervals over one month:
- average vehicle speed in km/h
- time of the observations
- the day of the week
Thus having 288 (12*24) data points a day. I'm trying to predict the average vehicle speed during the peak hours of the day with a seasonality of 24 hours as well as considering the day of the week by including dummy variables as
xreg. However, I don't know if this is the right approach to deal with multiple / complex seasonality in daily data.
My code is the following:
speed <- ts(data$avgVehicleSpeed, frequency = 288) xreg <- model.matrix(~factor(data$day)+0)[, 2:7] arima <- auto.arima(speed, seasonal = TRUE, xreg = xreg) forecast <- forecast(arima, h = 12, xreg = xreg)
However, when running this code the
auto.arima function takes FOREVER to run. Even a predetermined ARIMA model with the same inputs takes very long to run. I have a feeling that it's because of frequency = 288. So my question is, why does R takes so long to determine the "best" ARIMA model for the given inputs? Or what am I doing wrong trying to fit the seasonal ARIMA model.