BIVARIATE GARCH BEKK
Moderators: EViews Gareth, EViews Moderator
BIVARIATE GARCH BEKK
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.
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 510 times
-
- 10 MINS DATA.xlsx
- (91.37 KiB) Downloaded 440 times
Re: BIVARIATE GARCH BEKK
Hi,
I tried with a different set of codes but still have same error. I have attached the Eviews file here.
Kindly assist.
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 555 times
-
- BIVARIATE GARCH -ERROR.WF1
- (697.88 KiB) Downloaded 380 times
Re: BIVARIATE GARCH BEKK
PLEASE can someone HELP?
Re: BIVARIATE GARCH BEKK
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 358 times
Re: BIVARIATE GARCH BEKK
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.
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.
Re: BIVARIATE GARCH BEKK
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
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 377 times
Re: BIVARIATE GARCH BEKK
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:
Changing the optimization algorithm might also be helpful:
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)
Re: BIVARIATE GARCH BEKK
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,
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,
Re: BIVARIATE GARCH BEKK
Make a fresh start: Clear everything in the workfile except your variables "spot" and "futures"...
Re: BIVARIATE GARCH BEKK
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"
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"
Re: BIVARIATE GARCH BEKK
Could you please post your EViews workfile? (not the Excel file)
Re: BIVARIATE GARCH BEKK
I have posted the 30 minutes and 10 minutes files.
Thank you for your patience.
Thank you for your patience.
- Attachments
-
- 30 mins 1.wf1
- (138.45 KiB) Downloaded 336 times
-
- 10 mins data.wf1
- (862.33 KiB) Downloaded 318 times
Re: BIVARIATE GARCH BEKK
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
Re: BIVARIATE GARCH BEKK
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
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
Who is online
Users browsing this forum: No registered users and 32 guests