23

I am trying to fit ARIMA model of a seasonally decomposed series. But when I try to execure following:

fit = arima(diff(series), order=c(1,0,0),
   seasonal = list(order = c(1, 0, 0), period = NA))

It gives me following error:

Error in arima(diff(series), order = c(1, 0, 0), seasonal = list(order = c(1, : non-stationary seasonal AR part from CSS

what is wrong and what does the error mean?

mihsathe
  • 8,904
  • 12
  • 38
  • 54

1 Answers1

41

When using CSS (conditional sum of squares), it is possible for the autoregressive coefficients to be non-stationary (i.e., they fall outside the region for stationary processes). In the case of the ARIMA(1,0,0)(1,0,0)s model that you are fitting, both coefficients should be between -1 and 1 for the process to be stationary.

You can force R to use MLE (maximum likelihood estimation) instead by using the argument method="ML". This is slower but gives better estimates and always returns a stationary model.

If you are differencing the series (as you are here), it is usually better to do this via the model rather than explicitly. So your model would be better estimated using

set.seed(1)
series <- ts(rnorm(100),f=6)
fit <- arima(series, order=c(1,1,0), seasonal=list(order=c(1,0,0),period=NA), 
         method="ML")
Rob Hyndman
  • 30,301
  • 7
  • 73
  • 85
  • 2
    This gives me following error: `Error in optim(init[mask], armafn, method = optim.method, hessian = TRUE, : non-finite finite-difference value [1]` – mihsathe Aug 30 '11 at 00:35
  • 1
    I can't replicate your error and I suspect it has something to do with your data. The above code (now updated to include an artificial data set) works. – Rob Hyndman Aug 30 '11 at 06:37
  • Sir, you can check the data.. http://mihirsathe.com/mihir/STI/STI/drugs/index.html the seasonal decomposed part is what I am tryin to model and predict – mihsathe Aug 30 '11 at 12:19
  • If you mean the seasonal component, then it is exactly periodic so it makes no sense to fit an ARIMA model. – Rob Hyndman Aug 30 '11 at 12:56
  • Yes I just got that from http://stats.stackexchange.com/questions/14948/seasonal-data-forecasting-issues and I am already ashamed of myself. Thank you so much for your help sir. – mihsathe Aug 30 '11 at 13:03