I want to fit an ARMA-GARCH model to my data using rugarch package in R.
First of all, I look at the acf and pacf:
install.packages("forecast") library(forecast) par(mfrow=c(2,1)) Acf(mydata,main="ACF",cex.axis=1.2,cex.lab=1.2,ci.type="ma") Acf(mydata,type="partial",main="PACF",cex.axis=1.2,cex.lab=1.2)
this gives the following images:
As you can see, the first, second and third lag are not significant. The 4th and the 5th are significant. I decided to use two models for my mean equation: no model (since the intercept is not significant, I checked this) and a modified ARMA(5,5), where the ar1, ar2, ar3, ma1, ma2, mar3 coefficients and the mean are fixed to zero.
Let's consider only the second model. I estimate the model via
library(lmtest) mymodel<-arima(mydata, order=c(5,0,5),include.mean=FALSE,fixed=c(0,0,0,NA,NA,0,0,0,NA,NA))
which gives the output
I get the p-values via
which shows, that all coeff are highly significant.
Now I look at the residuals:
resid<-mymodel$residuals par(mfrow=c(2,1)) Acf(resid,main="ACF of the residuals of the mean equation, \nmodified ARMA(5,5), zero mean",cex.axis=1.2,cex.lab=1.2) Acf(resid,type="partial",main="PACF of the residuals of the mean equation, \nmodified ARMA(5,5), zero mean",cex.axis=1.2,cex.lab=1.2)
which gives the following images:
As you can see, I could "kill" the dependence at the low lag orders.
Now I do the joint estimation using the rugarch package.
spec2<-ugarchspec(variance.model = list(model = "sGARCH", garchOrder = c(1, 1)), mean.model = list(armaOrder = c(5, 5), include.mean = FALSE), distribution.model = "norm",fixed.pars=list(ar1=0,ar2=0,ar3=0,ma1=0,ma2=0,ma3=0)) model2<-ugarchfit(spec=spec2,data=mydata)
I look at the output by just entering
model2, the relevant parameter output is:
1.Is it correct, that the coefficients are now different to the coefficients of the arima output?
I now look at
and this gives the following image:
2.This is the acf of the observations, but I want to have the acf AND the pacf of the residuals. How can I get them? (not the acf of the standardized residuals of the volatility equation, this would be the 10th and the 11th plot).