BIVARIATE GARCH BEKK

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

nenolusi
Posts: 18
Joined: Wed Jun 17, 2015 1:10 am

BIVARIATE GARCH BEKK

Postby nenolusi » Thu Aug 27, 2015 3:52 am

Hi,

Please I need assistance on estimating the Bivarate GARCH BEKK. I used the attached codes to estimate the model but cannot generate the output. The system says "LogL estimates are not valid". I have been trying to resolve this since. At this point, I am stock on my dissertation. Can you please tell me if I there is anything I can do to get the estimated results.
I have attached my data and the code I used.

Thanking you in advance for your response.
Attachments
BV.docx
(18.27 KiB) Downloaded 508 times
10 MINS DATA.xlsx
(91.37 KiB) Downloaded 436 times

nenolusi
Posts: 18
Joined: Wed Jun 17, 2015 1:10 am

Re: BIVARIATE GARCH BEKK

Postby nenolusi » Thu Aug 27, 2015 4:48 am

Hi,

I tried with a different set of codes but still have same error. I have attached the Eviews file here.
Kindly assist.
Attachments
BEKK ESTIMATION C.pdf
(1.31 MiB) Downloaded 552 times
BIVARIATE GARCH -ERROR.WF1
(697.88 KiB) Downloaded 380 times

nenolusi
Posts: 18
Joined: Wed Jun 17, 2015 1:10 am

Re: BIVARIATE GARCH BEKK

Postby nenolusi » Fri Aug 28, 2015 4:37 am

PLEASE can someone HELP?

nenolusi
Posts: 18
Joined: Wed Jun 17, 2015 1:10 am

Re: BIVARIATE GARCH BEKK

Postby nenolusi » Fri Aug 28, 2015 5:49 am

Please can someone help! It's really frustrating. I have tried several times time. Still the same error message "Logl estimates are not valid" I have attached me most recent Eviews file. Am running out of time. PLEASE HELP!
Attachments
BEKK -ERROR.WF1
(496.39 KiB) Downloaded 357 times

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

Re: BIVARIATE GARCH BEKK

Postby trubador » Wed Sep 02, 2015 6:50 am

1) Please do not send private messages, because there is no need to.
2) You do not get help from anyone mainly because the problem you are having is not specific to your case.
3) Please do a careful and a thorough search in the forum.
4) If you still seek for help, then please provide "your version of the code" that is used in generating the workfile you shared.

nenolusi
Posts: 18
Joined: Wed Jun 17, 2015 1:10 am

Re: BIVARIATE GARCH BEKK

Postby nenolusi » Wed Sep 02, 2015 10:37 am

Thank you for your reply.
My sincere apologies.
I am using intraday data.
Eviews 8

Please find below my code. I not very familiar with coding. I modified the codes I found in the forum.

smpl @all
series r1 = dlog(spot)
series r2 = dlog(futures)

sample s0 @first @last-5
sample s1 @first+2 @last-5

smpl s0

equation eq1.arch(m=100,c=1e-5,h,b) r1 c
equation eq2.arch(m=100,c=1e-5,h,b) r2 c

coef(2) mu
mu(1) = eq1.c(1)
mu(2)= eq2.c(1)
coef(3) omega
omega(1)=eq1.c(2)
omega(2)=0
omega(3)=eq2.c(2)
coef(3) alpha
alpha(1) = eq1.c(3)
alpha(2) = eq2.c(3)
alpha(3) = (alpha(1)*alpha(2))^.5
coef(3) beta
beta(1)= eq1.c(4)
beta(2)= eq2.c(4)
beta(3) = (beta(1)*beta(2))^.5

!mlog2pi = 2*log(2*@acos(-1))

series cov_r1r2 = @cov(r1-mu(1), r2-mu(2))
series var_r1 = @var(r1)
series var_r2 = @var(r2)

series sqres1 = (r1-mu(1))^2
series sqres2 = (r2-mu(2))^2
series res1res2 = (r1-mu(1))*(r2-mu(2))

logl bvgarch
bvgarch.append @logl logl
bvgarch.append sqres1 = (r1-mu(1))^2
bvgarch.append sqres2 = (r2-mu(2))^2
bvgarch.append res1res2 = (r1-mu(1))*(r2-mu(2))

bvgarch.append var_r1 = omega(1)+beta(1)*var_r1(-1) + alpha(1)*sqres1(-1)
bvgarch.append var_r2 = omega(3)+beta(2)*var_r2(-1) + alpha(2)*sqres2(-1)
bvgarch.append cov_r1r2 = omega(2) +beta(3)*cov_r1r2(-1) + alpha(3)*res1res2(-1)

bvgarch.append deth = var_r1*var_r2 -cov_r1r2^2

bvgarch.append invh1 = var_r2/deth
bvgarch.append invh3 = var_r1/deth
bvgarch.append invh2 = -cov_r1r2/deth
bvgarch.append logl =-0.5*(!mlog2pi +(invh1*sqres1+2*invh2*res1res2 +invh3*sqres2)+ log(deth))

smpl s1
bvgarch.ml(showopts, m=100, c=1e-5,b)

series res1 = sqres1^.5
series res2 = sqres2^.5

series stres1 = res1 /(var_r1 ^ .5)
series stres2 = res2 /(var_r2 ^ .5)

series sqres1st = stres1^2
series sqres2st = stres2^2

series stres1res2 = res1*res2 /
(var_r1*var_r2)^.5

graph resids1.line stres1 r1
show resids1
graph resids2.line stres2 r2
show resids2

show bvgarch.output
graph varcov.line var_r1 var_r2 cov_r1r2
Attachments
10 MINS DATA.xlsx
(91.19 KiB) Downloaded 376 times

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

Re: BIVARIATE GARCH BEKK

Postby trubador » Thu Sep 03, 2015 1:36 am

You seem to experience a convergence problem. The most common source of this problem is due to bad starting values, unless the model is ill-defined. In your case, initializing the coefficients of covariance terms to zero might work:

Code: Select all

...
alpha(3) = 0
...
beta(3) = 0
...

Changing the optimization algorithm might also be helpful:

Code: Select all

bvgarch.ml(showopts, m=500, c=1e-5)

nenolusi
Posts: 18
Joined: Wed Jun 17, 2015 1:10 am

Re: BIVARIATE GARCH BEKK

Postby nenolusi » Thu Sep 03, 2015 4:42 am

Dear Trubador,

I made the changes on the program. But still can't generate the output. I am getting an error message 'Syntax error in 'LOGL BVGARCH".

Please advise.

Thank you,

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

Re: BIVARIATE GARCH BEKK

Postby trubador » Thu Sep 03, 2015 5:38 am

Make a fresh start: Clear everything in the workfile except your variables "spot" and "futures"...

nenolusi
Posts: 18
Joined: Wed Jun 17, 2015 1:10 am

Re: BIVARIATE GARCH BEKK

Postby nenolusi » Thu Sep 03, 2015 6:00 am

Thank you for you reply.

I did a fresh start. But I am getting the same error message. Do you think the problem might be from my data set. I tried the code on the 30minutes interval and got same error "syntax error in LOGL BVGARCH"

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

Re: BIVARIATE GARCH BEKK

Postby trubador » Thu Sep 03, 2015 6:35 am

Could you please post your EViews workfile? (not the Excel file)

nenolusi
Posts: 18
Joined: Wed Jun 17, 2015 1:10 am

Re: BIVARIATE GARCH BEKK

Postby nenolusi » Thu Sep 03, 2015 6:57 am

I have posted the 30 minutes and 10 minutes files.

Thank you for your patience.
Attachments
30 mins 1.wf1
(138.45 KiB) Downloaded 336 times
10 mins data.wf1
(862.33 KiB) Downloaded 316 times

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

Re: BIVARIATE GARCH BEKK

Postby trubador » Thu Sep 03, 2015 7:09 am

You should also post the code. There is really no way to pinpoint the source of the problem, if I am not able to follow the exact steps. I cannot replicate the situation. Anyway, it seems the code you use puts "bvgarch.append" expressions in front of each line in the LogL object. That causes the problem. Use the following code as well as the workfile attached:

Code: Select all

smpl @all
series r1 = dlog(spot)
series r2 = dlog(futures)

sample s0 @first @last-5
sample s1 @first+2 @last-5

smpl s0

equation eq1.arch(m=100,c=1e-5,h,b) r1 c
equation eq2.arch(m=100,c=1e-5,h,b) r2 c

coef(2) mu
mu(1) = eq1.c(1)
mu(2)= eq2.c(1)
coef(3) omega
omega(1)=eq1.c(2)
omega(2)=0
omega(3)=eq2.c(2)
coef(3) alpha
alpha(1) = eq1.c(3)
alpha(2) = eq2.c(3)
alpha(3) = 0
coef(3) beta
beta(1)= eq1.c(4)
beta(2)= eq2.c(4)
beta(3) = 0

!mlog2pi = 2*log(2*@acos(-1))

series cov_r1r2 = @cov(r1-mu(1), r2-mu(2))
series var_r1 = @var(r1)
series var_r2 = @var(r2)

series sqres1 = (r1-mu(1))^2
series sqres2 = (r2-mu(2))^2
series res1res2 = (r1-mu(1))*(r2-mu(2))

logl bvgarch
bvgarch.append @logl logl
bvgarch.append sqres1 = (r1-mu(1))^2
bvgarch.append sqres2 = (r2-mu(2))^2
bvgarch.append res1res2 = (r1-mu(1))*(r2-mu(2))

bvgarch.append var_r1 = omega(1)+beta(1)*var_r1(-1) + alpha(1)*sqres1(-1)
bvgarch.append var_r2 = omega(3)+beta(2)*var_r2(-1) + alpha(2)*sqres2(-1)
bvgarch.append cov_r1r2 = omega(2) +beta(3)*cov_r1r2(-1) + alpha(3)*res1res2(-1)

bvgarch.append deth = var_r1*var_r2 -cov_r1r2^2

bvgarch.append invh1 = var_r2/deth
bvgarch.append invh3 = var_r1/deth
bvgarch.append invh2 = -cov_r1r2/deth
bvgarch.append logl =-0.5*(!mlog2pi +(invh1*sqres1+2*invh2*res1res2 +invh3*sqres2)+ log(deth))

smpl s1
bvgarch.ml(showopts, m=500, c=1e-5)

series res1 = sqres1^.5
series res2 = sqres2^.5

series stres1 = res1 /(var_r1 ^ .5)
series stres2 = res2 /(var_r2 ^ .5)

series sqres1st = stres1^2
series sqres2st = stres2^2

series stres1res2 = res1*res2/(var_r1*var_r2)^.5

graph resids1.line stres1 r1
show resids1
graph resids2.line stres2 r2
show resids2

show bvgarch.output
graph varcov.line var_r1 var_r2 cov_r1r2
Attachments
10 mins data.wf1
(106.49 KiB) Downloaded 390 times

nenolusi
Posts: 18
Joined: Wed Jun 17, 2015 1:10 am

Re: BIVARIATE GARCH BEKK

Postby nenolusi » Thu Sep 03, 2015 7:15 am

Thank you.

nenolusi
Posts: 18
Joined: Wed Jun 17, 2015 1:10 am

Re: BIVARIATE GARCH BEKK

Postby nenolusi » Thu Sep 03, 2015 7:27 am

I am still getting the same error message.

Please find below the code I used;
smpl @all
series r1 = dlog(spot)
series r2 = dlog(futures)

sample s0 @first @last-5
sample s1 @first+2 @last-5

smpl s0

equation eq1.arch(m=100,c=1e-5,h,b) r1 c
equation eq2.arch(m=100,c=1e-5,h,b) r2 c

coef(2) mu
mu(1) = eq1.c(1)
mu(2)= eq2.c(1)
coef(3) omega
omega(1)=eq1.c(2)
omega(2)=0
omega(3)=eq2.c(2)
coef(3) alpha
alpha(1) = eq1.c(3)
alpha(2) = eq2.c(3)
alpha(3) = 0
coef(3) beta
beta(1)= eq1.c(4)
beta(2)= eq2.c(4)
beta(3) = 0
!mlog2pi = 2*log(2*@acos(-1))

series cov_r1r2 = @cov(r1-mu(1), r2-mu(2))
series var_r1 = @var(r1)
series var_r2 = @var(r2)

series sqres1 = (r1-mu(1))^2
series sqres2 = (r2-mu(2))^2
series res1res2 = (r1-mu(1))*(r2-mu(2))

logl bvgarch
bvgarch.append @logl logl
bvgarch.append sqres1 = (r1-mu(1))^2
bvgarch.append sqres2 = (r2-mu(2))^2
bvgarch.append res1res2 = (r1-mu(1))*(r2-mu(2))

bvgarch.append var_r1 = omega(1)+beta(1)*var_r1(-1) + alpha(1)*sqres1(-1)
bvgarch.append var_r2 = omega(3)+beta(2)*var_r2(-1) + alpha(2)*sqres2(-1)
bvgarch.append cov_r1r2 = omega(2) +beta(3)*cov_r1r2(-1) + alpha(3)*res1res2(-1)

bvgarch.append deth = var_r1*var_r2 -cov_r1r2^2

bvgarch.append invh1 = var_r2/deth
bvgarch.append invh3 = var_r1/deth
bvgarch.append invh2 = -cov_r1r2/deth
bvgarch.append logl =-0.5*(!mlog2pi +(invh1*sqres1+2*invh2*res1res2 +invh3*sqres2)+ log(deth))

smpl s1
bvgarch.ml(showopts, m=500, c=1e-5)
series res1 = sqres1^.5
series res2 = sqres2^.5

series stres1 = res1 /(var_r1 ^ .5)
series stres2 = res2 /(var_r2 ^ .5)

series sqres1st = stres1^2
series sqres2st = stres2^2

series stres1res2 = res1*res2 /
(var_r1*var_r2)^.5

graph resids1.line stres1 r1
show resids1
graph resids2.line stres2 r2
show resids2

show bvgarch.output
graph varcov.line var_r1 var_r2 cov_r1r2


Return to “Estimation”

Who is online

Users browsing this forum: Google [Bot] and 15 guests