[R] Generalized DCC GARCH ML estimation
drinky_1
Benno_Haydl at web.de
Sun Jun 6 19:17:50 CEST 2010
Hi everyone,
I want to do a maximum likelihood estimation for the Generalized Dynamic
Conditional Correlation (GDCC) Model of Hafner and Franses (2009), but I
don't know how exactly. I hope you can help me. This is what I have so far.
Well first of all Hafner models the conditional covariance matrix H_t as
follows:
H=D*R*D, where D is a diagonal matrix with the square root of the estimated
univariate GARCH variances, R is a correlation matrix:
R_t=diag(Q_t)^(-1/2)*Q_t*diag(Q_t)^(-1/2) and
Q_t=S(1-mean(a)^2-mean(b)^2)+ aa' * (eps_(t-1)*eps')+ bb'*Q_(t-1)
a and b are parameter vectors and S is the sample correlation matrix of the
eps.
There is a two-step estimation method, but I only need the second step.
So first of all I want to calculate the correlations
gdcc=function (dvar,alpha,beta)
{
T=dim(dvar)[1]
N=dim(dvar)[2]
uncR=cor(dvar)
R=list()
Q=list()
Q[[1]]=uncR
R[[1]]=diag(diag(uncR)^(-1/2))%*%uncR%*%diag(diag(uncR)^(-1/2))
for (i in 2:T)
{
Q[[i]]=uncR*(1-mean(alpha)^2-mean(beta)^2)+tcrossprod(alpha)*tcrossprod(dvar[i-1,])+tcrossprod(beta)*Q[[i-1]]
R[[i]]=diag(diag(Q[[i]])^(-1/2))%*%Q[[i]]%*%diag(diag(Q[[i]])^(-1/2))
GDCC[i,]=as.vector(R[[i]])
}
GDCC
}
and the log-likelihood function is as follows:
loglik.gdcc2=function (alpha,beta,dvar)
{
T <- dim(dvar)[1]
N <- dim(dvar)[2]
GDCC=gdcc(dvar,alpha,beta)
lf <- numeric(N)
for (i in 1:T) {
R <- matrix(GDCC[i,], N, N)
invR <- solve(R)
lf[i] <- 0.5 * (log(det(R)) + sum(dvar[i, ] * crossprod(invR,
dvar[i, ])))
}
-sum(lf)
}
I want to use the nlm method. How can I estimate the parameter vectors a and
b? I really would appreciate it if anyone could help me.
Thank you very much.
Best regards, drinky_1
--
View this message in context: http://r.789695.n4.nabble.com/Generalized-DCC-GARCH-ML-estimation-tp2245135p2245135.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list