How to Create an ARIMA model with specific MA (or

2019-03-31 11:04发布

I'm having trouble figuring the particular way to use arima{stats} to create ARMA models that have specific MA terms that are specified by more than just the maximum number.

What I mean by that, is I need to specific an AR(1)MA(1,4) model that should result in an intercept, AR1 term, an MA1 term, and an MA4 term... but this is different than an AR(1)MA(4) model, which would have terms for MA1, MA2, MA3, and MA(4).

I can do this just fine with the arma function from the tseries package.

> ar1ma14.model<-arma(ppi.d, lag=list(ar=1, ma=c(1,4)))
Warning message:
In arma(ppi.d, lag = list(ar = 1, ma = c(1, 4))) : order is ignored

summary(ar1ma14.model)

Call:
arma(x = ppi.d, lag = list(ar = 1, ma = c(1, 4)))

Model:
ARMA(1,4)

Residuals:
   Min         1Q     Median         3Q        Max 
-0.0401487 -0.0056047  0.0004295  0.0045259  0.0379418 

Coefficient(s):
           Estimate  Std. Error  t value Pr(>|t|)    
ar1        0.765279    0.080376    9.521  < 2e-16 ***
ma1       -0.355297    0.102216   -3.476 0.000509 ***
ma4        0.297776    0.098485    3.024 0.002498 ** 
intercept  0.001855    0.001026    1.808 0.070603 .  

So it works with arma, but the arma function doesn't have the same forecast capabilities as arima.

I've tried every possibility of inserting a list as the q in the arima(p,d,q) and I can't find any examples of others having done it.

Does anyone have an idea?

1条回答
倾城 Initia
2楼-- · 2019-03-31 11:39

I figured it out.

This is what the seasonal parameter is for, which I suspected, but couldn't get it to work right.

Essentially the AR(1)MA(1,4) model is an AR(1)MA(1) model with a seasonal moving average at t-4 periods (which makes sense because this is quarterly data).

So the way to do it with arima is:

ar1ma14.model<-arima(ppi.d, order=c(1,0,1), seasonal=list(order=c(0,0,1), period=4))

Call:
arima(x = ppi.d, order = c(1, 0, 1), seasonal = list(order = c(0, 0, 1), period = 4))

Coefficients:
         ar1      ma1    sma1  intercept
      0.8077  -0.3877  0.2297     0.0076
s.e.  0.0855   0.1295  0.0891     0.0032

Similarly, I need to test an AR(2)MA(|4|) model, which only includes an MA4 term and not MA1, MA2, or MA3. So that will be an AR(2) model with a seasonal MA4...

ar2ma4.model<-arima(ppi.d, order=c(2,0,0), seasonal=list(order=c(0,0,1), period=4))

Call:
arima(x = ppi.d, order = c(2, 0, 0), seasonal = list(order = c(0, 0, 1), period = 4))

Coefficients:
         ar1     ar2    sma1  intercept
      0.4570  0.1611  0.2574     0.0078
s.e.  0.0769  0.0790  0.0841     0.0027

sigma^2 estimated as 0.0001147:  log likelihood = 523.37,  aic = -1036.75
查看更多
登录 后发表回答