# How to convert R output from auto.arima function into mathematical model?

I'm building a model using the auto.arima function in R, and it gives the following output:

arima(x = revtrend, order = c(2, 1, 2))
Coefficients:
ar1     ar2     ma1      ma2
1.1894 -0.1975  0.4387  -0.5613


Can someone help me write this as an actual mathematical model? I believe I'm getting a bit lost in the notation. Thank you!

• See these threads (you may need to narrow down the search further by adding terms like "output", "auto.arima" or other). May 22, 2023 at 10:51

Let $$B(.)$$ denote the backshift operator, i.e. $$B y_t = y_{t-1}$$. Then we can write a general non-seasonal ARIMA(p, d, q) as
$$\underbrace{(1 - \phi_1 B - ... - \phi_p B^p)}_{\text{AR(p)}} \ \underbrace{(1-B)^d}_{\text{d differences}} \ y_t = \underbrace{(1+\theta_1 B + ... + \theta_q B^q) \epsilon_t}_{\text{MA(q)}}$$
and $$\epsilon_t \overset{iid}{\sim}N(0, \sigma)$$
You just need to substitute the parameter estimates in with $$p=2, d=1, q=2$$. If you want to remove the backshift operator, simply expand everything out and notice that $$B^k y_t = y_{t-k}$$