tv-GARCH-in-mean model

For technical questions regarding estimation of single equations, systems, VARs, Factor analysis and State Space Models in EViews. General econometric questions and advice should go in the Econometric Discussions forum.

Moderators: EViews Gareth, EViews Moderator

helen
Posts: 7
Joined: Tue Nov 16, 2010 10:13 pm

tv-GARCH-in-mean model

Postby helen » Tue Nov 23, 2010 9:34 am

hi!everybody.
i want to estimate a tv-GARCH-in-mean model which is similar with the program here:http://forums.eviews.com/viewtopic.php?f=4&t=273.but there are some differences in the specify of mean queations.the mean eauation which i wanted is:
y1= lambda1*h(1,1)+lambda2*h(1,2)+lambda3*h(1,3)+ res1
y2=lambda2*h(2,2)+lambda3*h(2,3) + res2
y3=lambda3*h(3,3)+res3
i modified the code but i am not quite certain whether it is right.Can any one help me to check my code and advise me to modify them? I'm using Eviews 6.
Thanks!

Code: Select all

' tri-variate BEKK of Engle and Kroner (1995): 'mean equation ' y1= lambda1*h(1,1)+lambda2*h(1,2)+lambda3*h(1,3)+ res1 ' y2=lambda2*h(2,2)+lambda3*h(2,3) + res2 ' y3=lambda3*h(3,3)+res3 ' res ~ N(0,H) ' ' H = omega*omega' + beta H(-1) beta' + alpha res(-1) res(-1)' alpha' ' ' where, ' y = 3 x 1 ' lambda = 3 x 1 ' H = 3 x 3 (symmetric) ' H(1,1) = variance of y1 (saved as var_y1) ' H(1,2) = cov of y1 and y2 (saved as cov_y1y2) ' H(1,3) = cov of y1 and y2 (saved as cov_y1y3) ' H(2,2) = variance of y2 (saved as var_y2) ' H(2,3) = cov of y1 and y3 (saved as cov_y2y3) ' H(3,3) = variance of y3 (saved as var_y3) ' omega = 3 x 3 low triangular ' beta = 3 x 3 diagonal ' alpha = 3 x 3 diagonal 'change path to program path %path = @runpath cd %path ' load workfile load intl_fin.wf1 ' dependent variables of all series must be continues series y1 = dlog(sp500) series y2 = dlog(ftse) series y3 = dlog(nikkei) ' set sample ' first observation of s1 need to be one or two periods after ' the first observation of s0 sample s0 3/3/94 8/1/2000 sample s1 3/7/94 8/1/2000 ' initialization of parameters and starting values ' change below only to change the specification of model smpl s0 'get starting values from univariate GARCH equation eq1.arch(archm=var,m=100,c=1e-5) y1 equation eq2.arch(archm=var,m=100,c=1e-5) y2 equation eq3.arch(archm=var,m=100,c=1e-5) y3 'save the conditional variances eq1.makegarch garch1 eq2.makegarch garch2 eq3.makegarch garch3 ' declare coef vectors to use in GARCH model coef(3) lambda lambda(1) = eq1.c(1) lambda(2) = eq2.c(1) lambda(3) = eq3.c(1) coef(6) omega omega(1) = (eq1.c(2))^.5 omega(2) = 0 omega(3) = 0 omega(4) = eq2.c(2)^.5 omega(5) = 0 omega(6) = eq3.c(2)^.5 coef(3) alpha alpha(1) = (eq1.c(3))^.5 alpha(2) = (eq2.c(3))^.5 alpha(3) = (eq3.c(3))^.5 coef(3) beta beta(1) = (eq1.c(4))^.5 beta(2) = (eq2.c(4))^.5 beta(3) = (eq3.c(4))^.5 ' use sample var-cov as starting value of variance-covariance matrix series cov_y1y2 = @cov(y1-lambda(1)*garch1, y2-lambda(2)*garch2) series cov_y1y3 = @cov(y1-lambda(1)*garch1, y3-lambda(3)*garch3) series cov_y2y3 = @cov(y2-lambda(2)*garch2, y3-lambda(3)*garch3) series var_y1 = @var(y1-lambda(1)*garch1) series var_y2 = @var(y2-lambda(2)*garch2) series var_y3 = @var(y3-lambda(3)*garch3) series sqres1 = (y1-lambda(1)*garch1)^2 series sqres2 = (y2-lambda(2)*garch2)^2 series sqres3 = (y3-lambda(3)*garch3)^2 series res1res2 = (y1-lambda(1)*garch1)*(y2-lambda(2)*garch2) series res1res3 = (y1-lambda(1)*garch1)*(y3-lambda(3)*garch3) series res2res3 = (y2-lambda(2)*garch2)*(y3-lambda(3)*garch3) ' constant adjustment for log likelihood !mlog2pi = 3*log(2*@acos(-1)) ' ........................................................... ' LOG LIKELIHOOD ' set up the likelihood ' 1) open a new blank likelihood object name tvgarch ' 2) specify the log likelihood model by append ' ........................................................... logl tvgarch ' squared errors and cross errors tvgarch.append @logl logl tvgarch.append sqres1 = (y1-lambda(1)*var_y1-lambda(2)*cov_y1y2-lambda(3)*cov_y1y3)^2 tvgarch.append sqres2 = (y2-lambda(2)*var_y2-lambda(3)*cov_y2y3)^2 tvgarch.append sqres3 = (y3-lambda(3)*var_y3)^2 tvgarch.append res1res2 = (y1-lambda(1)*var_y1-lambda(2)*cov_y1y2-lambda(3)*cov_y1y3)*(y2-lambda(2)*var_y2-lambda(3)*cov_y2y3) tvgarch.append res1res3 = (y1-lambda(1)*var_y1-lambda(2)*cov_y1y2-lambda(3)*cov_y1y3)*(y3-lambda(3)*var_y3) tvgarch.append res2res3 = (y2-lambda(2)*var_y2-lambda(3)*cov_y2y3)*(y3-lambda(3)*var_y3) ' variance and covariance series tvgarch.append var_y1 = omega(1)^2 + beta(1)^2*var_y1(-1) + alpha(1)^2*sqres1(-1) tvgarch.append var_y2 = omega(2)^2+omega(4)^2 + beta(2)^2*var_y2(-1) + alpha(2)^2*sqres2(-1) tvgarch.append var_y3 = omega(3)^2+omega(5)^2+omega(6)^2 + beta(3)^2*var_y3(-1) + alpha(3)^2*sqres3(-1) tvgarch.append cov_y1y2 = omega(1)*omega(2) + beta(2)*beta(1)*cov_y1y2(-1) + alpha(2)*alpha(1)*res1res2(-1) tvgarch.append cov_y1y3 = omega(1)*omega(3) + beta(3)*beta(1)*cov_y1y3(-1) + alpha(3)*alpha(1)*res1res3(-1) tvgarch.append cov_y2y3 = omega(2)*omega(3) + omega(4)*omega(5) + beta(3)*beta(2)*cov_y2y3(-1) + alpha(3)*alpha(2)*res2res3(-1) ' determinant of the variance-covariance matrix tvgarch.append deth = var_y1*var_y2*var_y3 - var_y1*cov_y2y3^2-cov_y1y2^2*var_y3+2*cov_y1y2*cov_y2y3*cov_y1y3-cov_y1y3^2*var_y2 ' calculate the elements of the inverse of var_cov (H) matrix ' numbered as vech(inv(H)) tvgarch.append invh1 = (var_y2*var_y3-cov_y2y3^2)/deth tvgarch.append invh2 = -(cov_y1y2*var_y3-cov_y1y3*cov_y2y3)/deth tvgarch.append invh3 = (cov_y1y2*cov_y2y3-cov_y1y3*var_y2)/deth tvgarch.append invh4 = (var_y1*var_y3-cov_y1y3^2)/deth tvgarch.append invh5 = -(var_y1*cov_y2y3-cov_y1y2*cov_y1y3)/deth tvgarch.append invh6 = (var_y1*var_y2-cov_y1y2^2)/deth ' log-likelihood series tvgarch.append logl = -0.5*(!mlog2pi + (invh1*sqres1+invh4*sqres2+invh6*sqres3 +2*invh2*res1res2 +2*invh3*res1res3+2*invh5*res2res3 ) + log(deth)) ' remove some of the intermediary series 'tvgarch.append @temp invh1 invh2 invh3 invh4 invh5 invh6 sqres1 sqres2 sqres3 res1res2 res1res3 res2res3 deth ' estimate the model smpl s1 tvgarch.ml(showopts, m=100, c=1e-5) ' change below to display different output show tvgarch.output graph var.line var_y1 var_y2 var_y3 graph cov.line cov_y1y2 cov_y1y3 cov_y2y3 show var show cov ' LR statistic for univariate vs trivariate scalar lr = -2*(eq1.@logl + eq2.@logl + eq3.@logl - tvgarch.@logl) scalar lr_pval = 1 - @cchisq(lr,3)

trubador
Did you use forum search?
Posts: 1520
Joined: Thu Nov 20, 2008 12:04 pm

Re: tv-GARCH-in-mean model

Postby trubador » Wed Nov 24, 2010 2:37 am

Should be something like the following:

Code: Select all

' TRIVARIATE GARCH-in-MEAN PROGRAM (01/05/2009) ' example program for EViews 6.0 LogL object ' ' restricted (upper triangular) version of ' tri-variate BEKK of Engle and Kroner (1995): ' ' y = mu + lambda*H + res ' res ~ N(0,H) ' ' H = omega*omega' + beta*H(-1)*beta' + alpha*res(-1)*res(-1)'*alpha' ' ' where, ' y = 3 x 1 ' mu = 3 x 1 ' lambda = 3 x 3 (upper triangular) ' H = 3 x 3 (symmetric) ' H(1,1) = variance of y1 (saved as var_y1) ' H(1,2) = cov of y1 and y2 (saved as cov_y1y2) ' H(1,3) = cov of y1 and y3 (saved as cov_y1y3) ' H(2,2) = variance of y2 (saved as var_y2) ' H(2,3) = cov of y2 and y3 (saved as cov_y2y3) ' H(3,3) = variance of y3 (saved as var_y3) ' omega = 3 x 3 (lower triangular) ' beta = 3 x 3 (diagonal) ' alpha = 3 x 3 (diagonal) ' ''change path to program path '%path = @runpath 'cd %path ' '' load workfile 'load intl_fin.wf1 ' dependent variables of all series must be continuous series y1 = dlog(sp500) series y2 = dlog(ftse) series y3 = dlog(nikkei) ' set sample ' first observation of s1 need to be one or two periods after ' the first observation of s0 sample s0 3/3/94 8/1/2000 sample s1 3/7/94 8/1/2000 ' initialization of parameters and starting values ' change below only to change the specification of model smpl s0 'get starting values from univariate GARCH-in-mean equation eq1.arch(archm=var,m=100,c=1e-5) y1 c equation eq2.arch(archm=var,m=100,c=1e-5) y2 c equation eq3.arch(archm=var,m=100,c=1e-5) y3 c 'save the conditional variances eq1.makegarch garch1 eq2.makegarch garch2 eq3.makegarch garch3 ' declare coef vectors to be used in TVGARCHM model coef(6) lambda lambda(1) = eq1.c(1) lambda(2) = 0 lambda(3) = 0 lambda(4) = eq2.c(1) lambda(5) = 0 lambda(6) =eq3.c(1) coef(3) mu mu(1) = eq1.c(2) mu(2) = eq2.c(2) mu(3) = eq3.c(2) coef(6) omega omega(1) = (eq1.c(3))^.5 omega(2) = 0 omega(3) = 0 omega(4) = eq2.c(3)^.5 omega(5) = 0 omega(6) = eq3.c(3)^.5 coef(3) alpha alpha(1) = (eq1.c(4))^.5 alpha(2) = (eq2.c(4))^.5 alpha(3) = (eq3.c(4))^.5 coef(3) beta beta(1) = (eq1.c(5))^.5 beta(2) = (eq2.c(5))^.5 beta(3) = (eq3.c(5))^.5 ' use sample var-cov as starting value of variance-covariance matrix series cov_y1y2 = @cov(y1-mu(1)-lambda(1)*garch1, y2-mu(2)-lambda(4)*garch2) series cov_y1y3 = @cov(y1-mu(1)-lambda(1)*garch1, y3-mu(3)-lambda(6)*garch3) series cov_y2y3 = @cov(y2-mu(2)-lambda(4)*garch2, y3-mu(3)-lambda(6)*garch3) series var_y1 = @var(y1-lambda(1)*garch1) series var_y2 = @var(y2-lambda(4)*garch2) series var_y3 = @var(y3-lambda(6)*garch3) series sqres1 = (y1-mu(1)-lambda(1)*garch1)^2 series sqres2 = (y2-mu(2)-lambda(4)*garch2)^2 series sqres3 = (y3-mu(3)-lambda(6)*garch3)^2 series res1res2 = (y1-mu(1)-lambda(1)*garch1)*(y2-mu(2)-lambda(4)*garch2) series res1res3 = (y1-mu(1)-lambda(1)*garch1)*(y3-mu(3)-lambda(6)*garch3) series res2res3 = (y2-mu(2)-lambda(4)*garch2)*(y3-mu(3)-lambda(6)*garch3) ' constant adjustment for log likelihood !mlog2pi = 3*log(2*@acos(-1)) ' ........................................................... ' LOG LIKELIHOOD ' set up the likelihood ' 1) open a new blank likelihood object name tvgarch ' 2) specify the log likelihood model by append ' ........................................................... logl tvgarchm ' squared errors and cross errors tvgarchm.append @logl logl tvgarchm.append sqres1 = (y1-mu(1)-lambda(1)*var_y1-lambda(2)*cov_y1y2-lambda(3)*cov_y1y3)^2 tvgarchm.append sqres2 = (y2-mu(2)-lambda(4)*var_y2-lambda(5)*cov_y2y3)^2 tvgarchm.append sqres3 = (y3-mu(3)-lambda(6)*var_y3)^2 tvgarchm.append res1res2 = (y1-mu(1)-lambda(1)*var_y1-lambda(2)*cov_y1y2-lambda(3)*cov_y1y3(y2-mu(2)-lambda(4)*var_y2-lambda(5)*cov_y2y3) tvgarchm.append res1res3 = (y1-mu(1)-lambda(1)*var_y1-lambda(2)*cov_y1y2-lambda(3)*cov_y1y3)*(y3-mu(3)-lambda(6)*var_y3) tvgarchm.append res2res3 = (y2-mu(2)-lambda(4)*var_y2-lambda(5)*cov_y2y3)*(y3-mu(3)-lambda(6)*var_y3) ' variance and covariance series tvgarchm.append var_y1 = omega(1)^2 + beta(1)^2*var_y1(-1) + alpha(1)^2*sqres1(-1) tvgarchm.append var_y2 = omega(2)^2+omega(4)^2 + beta(2)^2*var_y2(-1) + alpha(2)^2*sqres2(-1) tvgarchm.append var_y3 = omega(3)^2+omega(5)^2+omega(6)^2 + beta(3)^2*var_y3(-1) + alpha(3)^2*sqres3(-1) tvgarchm.append cov_y1y2 = omega(1)*omega(2) + beta(2)*beta(1)*cov_y1y2(-1) + alpha(2)*alpha(1)*res1res2(-1) tvgarchm.append cov_y1y3 = omega(1)*omega(3) + beta(3)*beta(1)*cov_y1y3(-1) + alpha(3)*alpha(1)*res1res3(-1) tvgarchm.append cov_y2y3 = omega(2)*omega(3) + omega(4)*omega(5) + beta(3)*beta(2)*cov_y2y3(-1) + alpha(3)*alpha(2)*res2res3(-1) ' determinant of the variance-covariance matrix tvgarchm.append deth = var_y1*var_y2*var_y3 - var_y1*cov_y2y3^2-cov_y1y2^2*var_y3+2*cov_y1y2*cov_y2y3*cov_y1y3-cov_y1y3^2*var_y2 ' calculate the elements of the inverse of var_cov (H) matrix ' numbered as vech(inv(H)) tvgarchm.append invh1 = (var_y2*var_y3-cov_y2y3^2)/deth tvgarchm.append invh2 = -(cov_y1y2*var_y3-cov_y1y3*cov_y2y3)/deth tvgarchm.append invh3 = (cov_y1y2*cov_y2y3-cov_y1y3*var_y2)/deth tvgarchm.append invh4 = (var_y1*var_y3-cov_y1y3^2)/deth tvgarchm.append invh5 = -(var_y1*cov_y2y3-cov_y1y2*cov_y1y3)/deth tvgarchm.append invh6 = (var_y1*var_y2-cov_y1y2^2)/deth ' log-likelihood series tvgarchm.append logl = -0.5*(!mlog2pi + (invh1*sqres1+invh4*sqres2+invh6*sqres3 +2*invh2*res1res2 +2*invh3*res1res3+2*invh5*res2res3 ) + log(deth)) ' remove some of the intermediary series tvgarchm.append @temp invh1 invh2 invh3 invh4 invh5 invh6 sqres1 sqres2 sqres3 res1res2 res1res3 res2res3 deth ' estimate the model smpl s1 tvgarchm.ml(showopts, m=100, c=1e-5) ' change below to display different output show tvgarchm.output graph var.line var_y1 var_y2 var_y3 graph cov.line cov_y1y2 cov_y1y3 cov_y2y3 show var show cov ' LR statistic for univariate vs trivariate scalar lr = -2*(eq1.@logl + eq2.@logl + eq3.@logl - tvgarchm.@logl) scalar lr_pval = 1 - @cchisq(lr,3)
Last edited by trubador on Fri Nov 26, 2010 12:19 am, edited 1 time in total.

helen
Posts: 7
Joined: Tue Nov 16, 2010 10:13 pm

Re: tv-GARCH-in-mean model

Postby helen » Thu Nov 25, 2010 10:38 pm

Hi!tubador.thank you for reply.
there are still two problem:
1.I guess I have not made myself clear,in my case,some coefficient is equal in three mean equations,that is in your case lambda (2)= lambda (4),lambda (3)= lambda (5)= lambda (6).i wonder if i should declare "coef(6) lambda" or "coef(3) lambda"?if i declare coef(6) ,how should i express "lambda (2)= lambda (4),lambda (3)= lambda (5)= lambda (6)"?
in order to make it clearly, the specification of my mean equation shows in the attachment.

2.according to the specification of my mean equation ,i think residuals is something like this:
res1=y1-lambda(1)*var_y1-lambda(2)*cov_y1y2-lambda(3)*cov_y1y3
res2=y2-lambda(2)*var_y2-lambda(3)*cov_y2y3
res3= y3-lambda(3)*var_y3
i found in your case,it is
res1=y1-mu(1)-lambda(1)*var_y1-lambda(2)*var_y2-lambda(3)*var_y3
res2=y2-mu(2)-lambda(4)*var_y2-lambda(5)*var_y3
res3=y3-mu(3)-lambda(6)*var_y3

so i made the modify like this:

Code: Select all

' squared errors and cross errors tvgarch.append @logl logl tvgarch.append sqres1 = (y1-lambda(1)*var_y1-lambda(2)*cov_y1y2-lambda(3)*cov_y1y3)^2 tvgarch.append sqres2 = (y2-lambda(2)*var_y2-lambda(3)*cov_y2y3)^2 tvgarch.append sqres3 = (y3-lambda(3)*var_y3)^2 tvgarch.append res1res2 = (y1-lambda(1)*var_y1-lambda(2)*cov_y1y2-lambda(3)*cov_y1y3)*(y2-lambda(2)*var_y2-lambda(3)*cov_y2y3) tvgarch.append res1res3 = (y1-lambda(1)*var_y1-lambda(2)*cov_y1y2-lambda(3)*cov_y1y3)*(y3-lambda(3)*var_y3) tvgarch.append res2res3 = (y2-lambda(2)*var_y2-lambda(3)*cov_y2y3)*(y3-lambda(3)*var_y3)
am i right?

Thanks very much!
Attachments
tv-garch-m.doc
mean equation
(26 KiB) Downloaded 869 times

trubador
Did you use forum search?
Posts: 1520
Joined: Thu Nov 20, 2008 12:04 pm

Re: tv-GARCH-in-mean model

Postby trubador » Fri Nov 26, 2010 12:08 am

Then you need a more simplified/restricted version. I might have misunderstood. Declaring a coefficient vector of size 3 should be sufficient and your corrections seem OK...

helen
Posts: 7
Joined: Tue Nov 16, 2010 10:13 pm

Re: tv-GARCH-in-mean model

Postby helen » Fri Nov 26, 2010 6:01 am

thank you for your patience ,trubador :)

helen
Posts: 7
Joined: Tue Nov 16, 2010 10:13 pm

Re: tv-GARCH-in-mean model

Postby helen » Fri Nov 26, 2010 7:13 am

Hi,tubador!thank you for your repaly.

I meet a conflicting problem and i have no idea how to solve it .
My problem is :i need to make coefficient restriction test of "lambda(2)=0,lambda(3)=0"in the first mean equation,but they must not zero in the other two.but the wald test would restrict all lambda(2)and lambda(3 ) be zero in three equation .
In that case declaring a coefficient vector of size 6 like you do should be better,so the coefficient could be tested respectively.but this requires that the coefficient must be restricted as follows when estimation:"lambda (2)= lambda (4),lambda (3)= lambda (5)= lambda (6)".

Could you give me a piece of advice about the solution of this problem?

Thanks very much!

ramadhan23
Posts: 7
Joined: Wed Oct 15, 2014 5:46 pm

Re: tv-GARCH-in-mean model

Postby ramadhan23 » Fri Oct 17, 2014 1:57 am

im working on a thesis about multivariate garch in mean, and i want all the lambdas have different coefficient? how would i write that in a program? is this correct?

for the declaration , im a bit confused on how should i declare it. btw, im kind of trying helens program which has mean equation like this

y1= lambda1*h(1,1)+lambda2*h(1,2)+lambda3*h(1,3)+ res1
y2=lambda4*h(2,2)+lambda5*h(2,3) + res2
y3=lambda6*h(3,3)+res3
res ~ N(0,H)


coef(6) lambda
lambda(1) = eq1.c(1)
lambda(2) = 0
lambda(3) = 0
lambda(4) = eq2.c(1)
lambda(5) = 0
lambda(6) =eq3.c(1)


coef(6) omega
omega(1) = (eq1.c(2))^.5
omega(2) = 0
omega(3) = 0
omega(4) = eq2.c(2)^.5
omega(5) = 0
omega(6) = eq3.c(2)^.5

coef(3) alpha
alpha(1) = (eq1.c(3))^.5
alpha(2) = (eq2.c(3))^.5
alpha(3) = (eq3.c(3))^.5

coef(3) beta
beta(1) = (eq1.c(4))^.5
beta(2) = (eq2.c(4))^.5
beta(3) = (eq3.c(4))^.5



for the logl object

tvgarch.append @logl logl
tvgarch.append sqres1 = (y1-lambda(1)*var_y1-lambda(2)*cov_y1y2-lambda(3)*cov_y1y3)^2
tvgarch.append sqres2 = (y2-lambda(4)*var_y2-lambda(5)*cov_y2y3)^2
tvgarch.append sqres3 = (y3-lambda(6)*var_y3)^2

tvgarch.append res1res2 = (y1-lambda(1)*var_y1-lambda(2)*cov_y1y2-lambda(3)*cov_y1y3)*(y2-lambda(4)*var_y2-lambda(5)*cov_y2y3)
tvgarch.append res1res3 = (y1-lambda(1)*var_y1-lambda(2)*cov_y1y2-lambda(3)*cov_y1y3)*(y3-lambda(6)*var_y3)
tvgarch.append res2res3 = (y2-lambda(4)*var_y2-lambda(5)*cov_y2y3)*(y3-lambda(6)*var_y3)

trubador
Did you use forum search?
Posts: 1520
Joined: Thu Nov 20, 2008 12:04 pm

Re: tv-GARCH-in-mean model

Postby trubador » Wed Oct 22, 2014 12:45 am

Seems OK. You would just drop the mu's from the code in the second post: http://forums.eviews.com/viewtopic.php? ... 358#p11338

ramadhan23
Posts: 7
Joined: Wed Oct 15, 2014 5:46 pm

Re: tv-GARCH-in-mean model

Postby ramadhan23 » Mon Oct 27, 2014 1:13 am

thank you for the reply trubador.

i want to ask more if i change the order of the multivariate garch-m into this:

y1= lambda1*h(1,1)+res1
y2=lambda2*h(2,2)+lambda3*h(1,2) + res2
y3= lambda4*h(3,3)+lambda5*h(2,3)+lambda6*h(1,3) + res3
res ~ N(0,H)


and what part should i change to make it work?

i already done this.

coef(6) lambda
lambda(1) = eq1.c(1)
lambda(2) = 0
lambda(3) = 0
lambda(4) = eq2.c(1)
lambda(5) = 0
lambda(6) =eq3.c(1)

coef(6) omega
omega(1) = (eq1.c(2))^.5
omega(2) = 0
omega(3) = 0
omega(4) = eq2.c(2)^.5
omega(5) = 0
omega(6) = eq3.c(2)^.5

coef(3) alpha
alpha(1) = (eq1.c(3))^.5
alpha(2) = (eq2.c(3))^.5
alpha(3) = (eq3.c(3))^.5

coef(3) beta
beta(1) = (eq1.c(4))^.5
beta(2) = (eq2.c(4))^.5
beta(3) = (eq3.c(4))^.5

series cov_y1y2 = @cov(y1-lambda(1)*garch1, y2-lambda(2)*garch2)
series cov_y1y3 = @cov(y1-lambda(1)*garch1, y3-lambda(4)*garch3)
series cov_y2y3 = @cov(y2-lambda(2)*garch2, y3-lambda(4)*garch3)
series var_y1 = @var(y1-lambda(1)*garch1)
series var_y2 = @var(y2-lambda(2)*garch2)
series var_y3 = @var(y3-lambda(4)*garch3)

series sqres1 = (y1-lambda(1)*garch1)^2
series sqres2 = (y2-lambda(2)*garch2)^2
series sqres3 = (y3-lambda(4)*garch3)^2

series res1res2 = (y1-lambda(1)*garch1)*(y2-lambda(2)*garch2)
series res1res3 = (y1-lambda(1)*garch1)*(y3-lambda(4)*garch3)
series res2res3 = (y2-lambda(2)*garch2)*(y3-lambda(4)*garch3)

and for the logl i made some changes on this

tvgarchm.append sqres1 = (y1-lambda(1)*var_y1)^2
tvgarchm.append sqres2 = (y2-lambda(2)*var_y2-lambda(3)*cov_y1y2)^2
tvgarchm.append sqres3 = (y3-lambda(4)*var_y3-lambda(5)*cov_y2y3-lambda(6)*cov_y1y3)^2

tvgarchm.append res1res2 = (y1-lambda(1)*var_y1)*(y2-lambda(2)*var_y2-lambda(3)*cov_y1y2)
tvgarchm.append res1res3 =(y1-lambda(1)*var_y1)*(y3-lambda(4)*var_y3-lambda(5)*cov_y2y3-lambda(6)*cov_y1y3)
tvgarchm.append res2res3 = (y2-lambda(2)*var_y2-lambda(3)*cov_y1y2)*(y3-lambda(4)*var_y3-lambda(5)*cov_y2y3-lambda(6)*cov_y1y3)

is this correct declaration?

if you dont mind checking, i have attched my code on this comment, thank you.

one more thing, if i want to incorporate information variables in this model, do you know how to put it on each equation?
Attachments
mulgarchmtest3.prg
(5.69 KiB) Downloaded 899 times

trubador
Did you use forum search?
Posts: 1520
Joined: Thu Nov 20, 2008 12:04 pm

Re: tv-GARCH-in-mean model

Postby trubador » Mon Oct 27, 2014 1:29 pm

if i want to incorporate information variables in this model, do you know how to put it on each equation?
There is nothing specific about incorporating exogenous variables in this setting. First you change the definition of residuals and then update related equations accordingly.

ramadhan23
Posts: 7
Joined: Wed Oct 15, 2014 5:46 pm

Re: tv-GARCH-in-mean model

Postby ramadhan23 » Mon Oct 27, 2014 5:41 pm

Screen Shot 2014-10-16 at 7.50.26 AM.jpg
Screen Shot 2014-10-16 at 7.50.26 AM.jpg (61.72 KiB) Viewed 16210 times
Screen Shot 2014-10-28 at 7.34.17 AM.png
Screen Shot 2014-10-28 at 7.34.17 AM.png (38.38 KiB) Viewed 16210 times
trubador thank you for reply,

so what you mean is i can incorporate information variables using the same way for defining covariance in mean equation?

as the picture i attached, the lambda is the information variables. actually, i dont really understand on how to define that in eviews. do you have any suggestion or idea?

thank you


Return to “Estimation”

Who is online

Users browsing this forum: No registered users and 2 guests