# How is mean calculated in ARIMA models?

I am currently working with ARIMA models and I am a little confused about the way they are formulated. I found Rob J. Hyndman's blog post "Constants and ARIMA models in R" explaining it.

But still, I'm confused. I am looking to fit an ARIMA(1,2,1) model to my dataset, $y_t$ for $t=1,...,n$. I gather from the website that it takes the form

$$(1-\phi B)(1-B)^2y_t=\mu(1-\phi)+(1+\theta B)\varepsilon_t$$

with $\mu$ being the mean of $(1-B)^2y_t$, that is the mean of

$$y_t-2y_{t-1}+y_{t-2}.$$

I guess I don't understand which $y_t$'s we need to take the mean of. Is it those of our dataset? Or if otherwise $y_t$ would depend on $y_t$ itself which does not make much sense.

• What is actually the question? (The title of the post could be made more specific, I think.) – Richard Hardy May 18 '16 at 19:29
• The question is how the mean of $\mu$ is calculated. I apologise for the title, I'm not too familiar with the terminology. – user128836 May 19 '16 at 8:05
• I was going through my old answers and noticed this one was not accepted. Do you perhaps need further clarification? – Richard Hardy Feb 15 '17 at 10:48

I guess I don't understand which $y_t$'s we need to take the mean of. Is it those of our dataset? Or if otherwise $y_t$ would depend on $y_t$ itself which does not make much sense.
Yes, you estimate the mean of $(1-B)^2 y_t$ using the data set at hand. And yes, the fitted value of $y_t$ depends on all data points $\{y_t\}_{t=1}^T$ (thus including the data points succeeding $y_t$ in time).
However, the model specifies that $y_t$ (not its fitted value) depends only on the past $y_t$s.
• I see, thanks. So given my dataset $y_t$, $t=1,...,n$ we should get $\mu=\frac{1}{n-2}(y_t-2y_{t-1}+y_{t-2})$, $t=3,...,n$, yes? This just dosen't give what the forecast package gives. – user128836 May 26 '16 at 10:15