title: Predict for arima
body: <p>After I use arima predict, I got the result of out of sample. And then I calculated by hand like <code>coefficient(fit)%*% c(1,y(future value))</code> for forecasting.</p>
  
  <h2>However those two are different!! I think those values should be same.What happen to them? I missed something about that?</h2>
  
  <p>This is simple example.</p>
  
  <pre><code>set.seed(1)
  zts &lt;- ts(rnorm(240), start=c(1990,1), frequency=12)
  fit &lt;- arima(window(zts, end=c(2000,12),frequency=12), order=c(1,0,0))
  Call:
  arima(x = window(zts, end = c(2000, 12), frequency = 12), order = c(1, 0, 0))
  
  Coefficients:
           ar1  intercept
         -0.0153     0.0954
   s.e.   0.0872     0.0732
  
  sigma^2 estimated as 0.7294:  log likelihood = -166.47,  aic = 338.94
  
  predict(fit, n.ahead=1)
  $pred
         Jan
  2001 0.1059105
  
   $se
         Jan
  2001 0.8540253
  </code></pre>
  
  <h3>I used the second method!</h3>
  
  <pre><code>t (c(0.0954, -0.0153 ))%*%c(1, 0.531496193)
  : 0.08726811
  </code></pre>
  
  <p>===========>  0.08726811 is different 0.1059105.</p>