title: Fitting ARIMA+GARCH in R
body: <p>I have a line of code in R:</p>
  
  <pre><code>garchFit(substitute(formula~arma(p,q)+garch(1,1),  
  list(p=auto.arima(data[i:(i+T-1)])$arma[1],q=auto.arima(data[i:(i+T-1)])$arma[2])),  
  data = data[i:(i+T-1)],trace=F)  
  </code></pre>
  
  <p>which is fitted repeatedly in a "for" loop for different i but unfortunately produces an error at when i reaches 3613.</p>
  
  <p>The code is designed to fit "best-fit" ARIMA model to the data ANF Garch(1,1) as there doesn't appear to be automatic "best fit" GARCH function in R unlike auto-arima.</p>
  
  <p>The error is: <code>Error in arima(.series$x, order = c(u, 0, v), include.mean = include.mean) : non-stationary AR part from CSS.</code>.</p>
  
  <p>In addition warning is produced: <code>In sqrt(diag(fit$cvar)) : NaNs produced.</code></p>
  
  <p>Any help on how to solve this issue much appreciated.</p>