I'm diving into arima models and was trying to repreduce the results of auto regression.

here is a reproducable example:

z=arima.sim(n = 101, list(ar = c(0.8)))

when running ar(1) without an intercept

> ceof(arima(z, order = c(1,0,0),include.mean =FALSE))

when comparing to a linear regression

> coef(lm(z[2:101] ~ z[1:100] + 0))

which are very similar and can be explained by the different methods used. However when I do this comparison with models that include an intercept, I get again similar results in the ar1 coefficient but very different measures for the intercept. while the intercept that I get in the arima model is the one that makes less sense to me.

> coef(arima(z, order = c(1,0,0)))
      ar1 intercept 
0.7274511 0.4241322 
> coef(lm(z[2:101] ~ z[1:100]))
(Intercept)    z[1:100] 
  0.1578015   0.7130261 

Any ideas on these differencing and in what way the arima procedure is different?


2 Answers 2


The thing that's called an "intercept" in the output of the arima function in R, isn't -- not what you'd normally think of as an intercept, anyway. It's actually the estimate of the $\mu$ parameter:

\begin{eqnarray} (y_t-\mu) &=& \phi_1(y_{t-1}-\mu)+\varepsilon_t\\ &=&\mu + \phi_1 y_{t-1}-\phi_1\mu+\varepsilon_t\\ &=&\mu(1-\phi_1) + \phi_1 y_{t-1}+\varepsilon_t\\ &=&\phi_0 + \phi_1 y_{t-1}+\varepsilon_t \end{eqnarray}

If you calculate $\phi_0=\mu(1-\phi_1)$ for the ARIMA model, it's much closer to that of the conditional least squares model:

 0.4241322 *(1-0.7274511)
[1] 0.1155968

As for why the (now equivalent) coefficients are similar but different, that's essentially down to the arima function including the likelihood for the first observation, which your lm fit conditions on.


I could actually close the question but maybe it would be useful to others:

found the answer in this site

after following the link from this stackoverflow question

  • $\begingroup$ link-only answers are not preferred ... can you edit the question to include essential information from the linked site? $\endgroup$
    – Ben Bolker
    Feb 4, 2018 at 3:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.