# Estimate single ARIMA for multiple timeseries

I have two groups of time-series, each group represents one type of data. However within each group, each time series may be fitted with a different ARIMA(p,d,q) from the other time series in the same group.

I need to create a single model for each group (Model_group1, Model_group2). I tried the approach mentioned by Rob Hyndman in: Estimating same model over multiple time series.

I need to use these two models to classify any time series to one of these two groups. For each time series, I calculated the AIC of Model_group1 and Model_group2, and the model with smaller AIC will mean that the time series belongs to its corresponding group.

I have three problems:

1. I received a warning message

Series: ts
ARIMA(3,0,2) with non-zero mean

Coefficients:
ar1     ar2     ar3     ma1      ma2  intercept
0.0714  0.1417  0.0000  0.0893  -0.0871     0.1169
s.e.     NaN  0.1381  0.0127     NaN   0.1436     0.0026

sigma^2 estimated as 0.2202:  log likelihood=-33822.63
AIC=67659.26   AICc=67659.26   BIC=67725.99
Warning message:
In sqrt(diag(x$var.coef)) : NaNs produced  This message was returned by only one of the group models. Does that mean that the fitted model is not correct? 2. I got two different results using auto.arima(ts, allowdrift=FALSE, stepwise=FALSE) auto.arima(ts, allowdrift=FALSE, stepwise=TRUE)  3. When I tested the resulting models, the majority of the time-series were classified as group_1, even when I test one of the time series used to build the long time series of group_2. I need to mention here that the composed time series of group_1 is quite shorter than the time series of group_2. Are there any expected reasons for that? ## 1 Answer 1. That can happen when the model is not suitable for the data. 2. stepwise=FALSE makes auto.arima work harder to find the best model. So of course, sometimes it finds a different model than when stepwise=TRUE. 3. It is impossible to say with the information provided. You should be aware that comparing AIC values with different values of$d$is inappropriate. The AIC can only be used to compare models with the same$d\$.

• Thanks for your answer.. The warning message returned by the model fitted by auto.arima how can the model be not suitable for the data?? In such cases, how to find the best fitted model? – M_T_JABER Nov 21 '13 at 22:49
• @RobHyndman Why is it no good to compare models with different d? – Tommaso Guerrini Oct 21 '16 at 8:37
• See #4 in robjhyndman.com/hyndsight/aic – Rob Hyndman Oct 21 '16 at 14:34