Skip to content
All library documents

Selecting an ARIMA(1,0,q) Model by BIC with Fixed AR Order

Article Quant Q&A · Author: Polar Bear

Summary

The document addresses how to select a moving-average order while keeping the autoregressive order fixed at one and differencing order fixed at zero. It notes that the illustrated automatic ARIMA search can choose an ARMA model without an AR(1) term, so its result does not satisfy a requirement to retain that term in every candidate.

The proposed method fits separate ARIMA(1,0,q) models for each MA order from zero through a chosen maximum, then computes BIC for each fit and selects the order with the lowest value. The example uses maximum likelihood estimation and expresses BIC through the model’s AIC calculation with a sample-size penalty. A follow-up function returns the estimated MA(1) coefficient from the selected model, or a missing value when the selected order is zero. This is a practical model-selection recipe, but the document does not discuss residual diagnostics, parameter uncertainty, stationarity checks, or whether the chosen lag range is adequate for a particular return series.

Key ideas

  • An unrestricted automatic ARIMA search may select a model without the required AR(1) term.
  • Fit a separate ARIMA(1,0,q) model for each candidate moving-average order.
  • Select the candidate with the lowest BIC over the chosen MA-order range.
  • If the selected MA order is zero, there is no MA(1) coefficient to report.
  • Model selection should be complemented by diagnostics that the example does not cover.

Tags

Full text
# Automate selection of BIC-minimizing ARIMA(1,0,X) model


# Automate selection of BIC-minimizing ARIMA(1,0,X) model












I want to estimate an ARIMA(1,0,X) model. The MA(X) in the model is selected to minimize BIC. I have the following code employing the function `auto.arima` from "forecast" package in R:

```
 auto.arima(logret$appl, d=0, max.p=1, max.q=10,
 max.order=NA, max.d=0,start.p=1, start.q=0,
 stationary=FALSE, seasonal=FALSE,
 ic=c("bic"), stepwise=TRUE, trace=TRUE,
 allowdrift=TRUE, allowmean=TRUE, lambda=NULL, parallel=FALSE, num.cores=NULL)
```

The following is the result of the above code

```
 ARIMA(1,0,0) with non-zero mean : -6592.886
 ARIMA(0,0,0) with non-zero mean : -6597.561
 ARIMA(1,0,0) with non-zero mean : -6592.886
 ARIMA(0,0,1) with non-zero mean : -6592.48
 ARIMA(0,0,0) with zero mean     : -6604.679
 ARIMA(1,0,1) with non-zero mean : -6586.55

Best model: ARIMA(0,0,0) with non-zero mean 

Series: logreturns$REL.CP 
ARIMA(0,0,0) with non-zero mean 

Coefficients:
      intercept
          0e+00
s.e.      5e-04

sigma^2 estimated as 0.0002818:  log likelihood=3305.9
AIC=-6607.81   AICc=-6607.8   BIC=-6597.56
```

My problem requires to keep `AR(1)` and `d=0` in all the models where I test MA lags. Is there a way to fix AR lags? What I really want is MA(1) coefficient out of this arima(1,0, X) model. Thanks

## Answer by Richard Hardy (score 1, accepted)

https://quant.stackexchange.com/a/25564

You can do it manually. Let `x` be the data series. The code below considers all moving-average lag orders between `0` and `max.q` and prints out the BIC-minimizing lag order and the corresponding estimated model:

```
m=list() # I will save estimated ARIMA(1,0,q) models here
BIC=c()  # I will save the corresponding BIC values here
max.q=10 # the maximum MA order you want to consider
n=length(x)
for(q in 0:max.q){
 m[[q+1]]=arima(x,order=c(1,0,q),method="ML")
 BIC[q+1]=AIC(m[[q+1]],k=log(n))
}
print(paste("BIC-optimal MA order is",which.min(BIC)-1)) # info message
print(m[[which.min(BIC)]]) # print the estimated BIC-optimal model
```

Edit:

To respond to a request in the comments, I am including a function that returns the estimated MA1 coefficient:

```
MA1fromARIMA10q=function(x,max.q=10,...){
 # x is a data vector (a time series)
 # max.q is the maximum MA order to be considered
 m=list() # I will save estimated ARIMA(1,0,q) models here
 BIC=c()  # I will save the corresponding BIC values here
 n=length(x)
 for(q in 0:max.q){
  m[[q+1]]=arima(x,order=c(1,0,q),...)
  BIC[q+1]=AIC(m[[q+1]],k=log(n))
 }
 q=which.min(BIC)-1
 if(q>0) MA1=coef(m[[q+1]])[2] else(MA1=NA) # if MA order is 0, assign NA
 return(MA1)
}
```

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.