[R-SIG-Finance] gogarch with multivariate t distribution

jun wang junluke at gmail.com
Tue Jan 6 06:17:24 CET 2015


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:

> The short answer is NO.
>
> The student and (gh) skew student are nested in the magh under appropriate
> parameter restrictions e.g. setting [gh]\lambda to -[student]shape/2 (with
> appropriate bounds on shape) and [gh]\beta->0 (for student) or
> [gh]\beta->|[gh]\alpha| (for gh skew student)...search google for 'Prause
> Generalized Hyperbolic' for more details.
>
> However, the representation in rmgarch is of the standardized magh
> ([sgh]\rho,[sgh]\zeta parameterization) which means you'd need to amend the
> code for this particular case...given that it's open source, it should be a
> 'breeze'.
>
> Alexios
>
>
> On 03/01/2015 21:45, jun wang wrote:
>
>> Dear all,
>>
>> Is there anyway to estimate the GOGARCH model with multivariate student t
>> distribution errors in the *rmgarch* package in R? The rmgarch package for
>> estimating gogarch model only covers "mvnorm",multivariate affine NIG
>> (“manig”) and GHYP (“magh”).
>>
>> Any hints would be very appreciated.
>>
>> Thanks,
>> Jun
>>
>>         [[alternative HTML version deleted]]
>>
>> _______________________________________________
>> R-SIG-Finance at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
>> -- Subscriber-posting only. If you want to post, subscribe first.
>> -- Also note that this is not the r-help list where general R questions
>> should go.
>>
>>
>

	[[alternative HTML version deleted]]



More information about the R-SIG-Finance mailing list