Hello,
I am new to eviews. I have codes for dvech in eviews. However, there is one point I want to make sure.
Below are my codes:
But as I define r1 and r2, should they be the residuals of the main series' equation or the main series itself? On the paper of Jelena Milovic, it says that the variables of r1 and r2 are the residulas of the ARMA process of the series BELEX 15 index and Hemofarm stock. But in other similar eviews codes such as bekk and dcc, series such r1 and r2 are the main series not the residuals of the main series. Do you have any suggestion?
My Kindest Regards,
series r1 =resp1
series r2 = respm
sample s0 1 2668
sample s1 2 2668
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^0.5
series res2=sqres2^0.5
series stres1=res1/(var_r1^0.5)
series stres2=res2/(var_r2^0.5)
series sqres1st=stres1^2
series sqres2st=stres2^2
series stres1res2=res1*res2/(var_r1*var_r2)^0.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
show varcov
Regarding the coding of dvech
Moderators: EViews Gareth, EViews Moderator
Re: Regarding the coding of dvech
A typical GARCH model assumes that the residuals from the mean equation is stationary and serially uncorrelated. In general, returns of financial assets do not violate this assumption and therefore can be directly used for the estimation. If this is not the case for the variable of interest (say r1), then you should build an ARIMA model for the mean equation instead of using only a constant.
Re: Regarding the coding of dvech
thank you very much.
Who is online
Users browsing this forum: No registered users and 2 guests
