Search code examples
rtime-seriesarima

garch model with fixed arma lags in R


I can't fit an ARMA-GARCH model with specific MA lags not estimated in time series data. For example I run the following code:

library(fGarch)
fitgi <- garchFit(~ arma(0,4)+ garch(1,1), data = gi, include.mean = F, trace = F)

and a part of the output is as below.


         Estimate  Std. Error  t value Pr(>|t|)
ma1     1.172e-01   2.991e-02    3.917 8.98e-05 ***
ma2     2.322e-02   2.917e-02    0.796   0.4260    
ma3    -1.301e-02   3.057e-02   -0.426   0.6703    
ma4    -6.619e-02   2.599e-02   -2.547   0.0109 *  
omega   2.570e-05   3.671e-06    7.000 2.55e-12 ***
alpha1  3.150e-01   3.728e-02    8.450  < 2e-16 ***
beta1   6.679e-01   2.393e-02   27.916  < 2e-16 ***

Since the ma2 and ma3 coefficients are not significant I would like to re-estimate the model estimating only the ma1 and ma4 coefficients for the arma model.

I tryed to fit an ARMA-GARCH model with fixed MA lags but I receive an error in the following code.

library(fGarch)
fitgi <- garchFit(~ arma(lag = list(ar=NULL, ma=c(1,4)))+ garch(1,1), 
  data = gi, include.mean = F, trace = F)

The error is :

  missing value where TRUE/FALSE needed
In addition: Warning message:
In .garchInitSeries(formula.mean = formula.mean, formula.var = formula.var,  :
  NAs introduced by coercion

The arma model with fixed ma coefficients is working fine as a stadalone but when it is in a garchFit model it doesn't work. Is there a proposition how can I fit a garch model with some ARMA coefficients omitted from the estimation in R?

I would appreciate any suggestion.


Solution

  • You can do that with rugarch:

    library(rugarch)
    set.seed(324)
    gi=as.ts(rnorm(200, 0.01,0.3))
    model <- ugarchspec(
      variance.model = list(model = "sGARCH", garchOrder = c(1, 1)),
      mean.model = list(armaOrder = c(1, 2), include.mean = TRUE),
      distribution.model = "norm",
      fixed.pars = list(ma2 = 0.86)  # Fix the ARMA lag parameter
    )
    
    fit <- ugarchfit(spec = model, data = gi)
    fit@fit$robust.matcoef
    
    
    
              Estimate  Std. Error     t value     Pr(>|t|)
    mu      0.02883778  0.04945789   0.5830775 0.5598411386  
    ar1     0.44670014  0.05100497   8.7579722 0.0000000000  
    ma1    -0.85733472  0.01445475 -59.3116443 0.0000000000  
    ma2     0.86000000          NA          NA           NA  
    omega   0.03168054  0.01252427   2.5295328 0.0114214484  
    alpha1  0.38166661  0.10492752   3.6374312 0.0002753707  
    beta1   0.56281251  0.04875034  11.5447923 0.0000000000