I am fitting monthly data that are expected to be auto-regressive (streamflow), but I want to include other independent variables (in my case it is a multivariate regression, with about 4 variables).

fit = glm(strea~X1+X2+X3+X4)

In order to consider correctly the autoregressive part, I considered ARMAX but I felt like a Linear regression with Autoregressive errors was more suitable for my problem.

I found this article very helpful - https://onlinecourses.science.psu.edu/stat510/node/72

Once I fit my regression, I analyzed my residuals, and as expected (from some preliminary analysis I had done) it seems like my residuals need a seasonal ARMA with ARMA(1,0)(2,1)[12].


These are the ACF and PACF of the residulas: ACF residuals PACF residuals

I fit a sarima model then:


These are the stastitics of this model fitted to the residuals

sarima output

which are decent - maybe not perfectly normal those quantiles, but definitely good enough for now.

My question is: how do I introduce this complicated model into my regression? The link above shows only simple examples, but not such a complex one.

I expect them to be something like:

y*t = y(t)-(a*y(t-1)+b*y(t-12)+c*y(t-24)+[w(t)+d*w(t-12)])

where a is from the AR(1) of the non seasonal part, and b,c are from the seasonal part, and d is from the seasonal MA(1) part.

But how do I go with my multiple independent variables? I am particuarly confused about the seasonal MA(1) part.

I am new to the SARIMA/ARMA. I basically would need help in deriving the equation that transforms my y(t) and x(t) to include in the regression.


  • $\begingroup$ Try transfer function modeling in ARIMA which would be able to accommodate very complicated models in a parsimonious way. $\endgroup$ – forecaster Jun 30 '15 at 20:44
  • $\begingroup$ Thanks forecaster, can you elaborate a bit on that? a link to something specific will help. $\endgroup$ – claude Jun 30 '15 at 20:55
  • $\begingroup$ Do you mean to add the xreg component to the arima call? I have seen that. I will definitely try it. I wanted though to understand more the details of the relationship, to know what happens behind the curtain. $\endgroup$ – claude Jun 30 '15 at 21:06

Your Answer

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

Browse other questions tagged or ask your own question.