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
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
tsfunction really necessary? Can I just specify everything in the
- 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
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.