I am new to time series and am trying to fit some time series data.
I understand the general concept of ARIMA model. However, as I read more textbooks and articles from Rob Hyndman, I realized I could put some regressors using the xreg
argument for the functions auto.arima
or arima
in R to get an ARMAX model. Therefore, I wonder if it is still necessary to include seasonality in ts(...,frequency)
as everything can be specified as dummy variable within the xreg
matrix and a more complicated seasonality structure (e.g. monthly seasonality) can be specified.
In addition, what would be a good way to check the accuracy of the forecast? I am fitting multiple time series data with a hierarchical structure. Using auto.arima
, I am able to select the best model and validate the model by looking at the residuals (check whether they are white noise). However, is there a way to even improve on the model if the prediction is still far from the actual data?
To sum up,
- Is the
frequency
argument ints
function really necessary? Can I just specify everything in thexreg
matrix? - What would be a normal routine to improve on model after selecting the appropriate ARIMA model with the lowest AIC?
Updates (Dec 17):
I am now able to fit an ARIMA model with SARIMA error by specifying xreg
argument and seasonal=F
. One issue that I have with that is, my xreg
matrix is not invertible (I assumed) and its not due to the presence of intercept term. Thus auto.arima()
only fit a c(0,0,0)
model.
I then tried using Arima()
to manually select model and it outputted the following error
Error in optim(init[mask], armafn, method = optim.method, hessian = TRUE, :
non-finite value supplied by optim
I check the xreg
matrix and it turns out column 48 (Day) and column 52 (2015) is causing the issue. Could you check if there's something wrong with my matrix structure ?
If you think this additional updates should be asked in stack overflow or additional question, I will move it.
xreg
argument andseasonal=F
" does not make sense to me. First, it is not ARIMA model but regression; second, you cannot have SARIMA error ifseasonal=F
, can you? Also, do you think having day-of-month dummies makes sense? (That depends on the nature of your data.) $\endgroup$xreg
only to include all my seasonality and thus produce a better fit. I am worried about a potential trend for the data from 2014 to 2015 so I include year as a dummy too. Back to the outputted error, originally it gave me another error regarding my matrix (I forgot what it is, something related to the matrix and a huge number 2exxxxx) then when I deleted those two columns, the code worked. Now its just producing the error above. $\endgroup$Arima()
failed to run. $\endgroup$