Skip to content
Prev 13046 / 15274 Next

gogarch with multivariate t distribution

Hi, Alexios,

Thanks for your quick response. I am still learning the DCC-GARCH model,
and i tried write the 2-stage estimation for the bi-variate DCC-GARCH(1,1)
and the estimates i got for the dcc parameters are different from the
"dccfit" function. I was wondering if you can give me any hints on what is
not right for my code.

Thanks!!!

data<-rv_indices[,2:3]
size1<-dim(data)
t<-size1[1]
k<-size1[2]

H<-matrix(0,nrow=size1[1]+1,ncol=size1[2])

fit1<-ugarchfit(model_base,data=data[,1]-mean(data[,1]))
fit2<-ugarchfit(model_base,data=data[,2]-mean(data[,2]))

res_1<-as.numeric(residuals(fit1))
res_2<-as.numeric(residuals(fit2))

vol_1<-as.numeric(sigma(fit1))
vol_2<-as.numeric(sigma(fit2))

res<-cbind(res_1,res_2)
vol<-cbind(vol_1,vol_2)
stdresid<-res/vol
Qbar=cov(stdresid);

stdresid=rbind(c(1,1),stdresid)

Qt<-array(0,c(2,2,t+1))
Rt<-array(0,c(2,2,t+1))
Qt[,,1]<-Qbar
Rt[,,1]<-Qbar
dcc_likhood_2<-function(startval){
a<-startval[1]
b<-startval[2]
logL=0;
likelihoods<-numeric(t+1)
for (j in 2:t+1){
  Qt[,,j]=Qbar*(1-a-b)
  Qt[,,j]=Qt[,,j]+a*(stdresid[j-1,]%*%t(stdresid[j-1,]));
  Qt[,,j]=Qt[,,j]+b*Qt[,,j-1]
  Rt[,,j]=Qt[,,j]/(sqrt(diag(Qt[,,j]))%*%sqrt(t(diag(Qt[,,j]))));

likelihoods[j]=log(det(Rt[,,j]))+t(stdresid[j,])%*%solve(Rt[,,j],tol=1e-21)%*%(stdresid[j,]);
  logL=logL+likelihoods[j]
}
return(logL)
}
startval<-c(0.04,0.93)
A <- matrix(c(-1, -1,1,0,0,1), 3, 2,byrow=TRUE)
B <- c(1,0,0)

llL<-maxBFGS(dcc_likhood_2,start=startval, constraints=list(ineqA=A,
ineqB=B))

On Sat, Jan 3, 2015 at 5:36 PM, alexios ghalanos <alexios at 4dscape.com>
wrote: