I have two equations. Both equations contain arch-in-mean.
Te first equation has one dummy in the variance equation.
The second equation is the regression of one lag variable in the first equation.
In code, there are like:
Code: Select all
equation eq1.ARCH(THRSH=1,GED,ARCHM=VAR,S=0,BACKCAST=0.7,DERIV=AA, m=100, c=1e-5) y1 C x1 x2(-1) x3 dummy1 @ DUMMY1
series y2=x2
equation eq2.ARCH(THRSH=1,GED,ARCHM=VAR,S=0,BACKCAST=0.7,DERIV=AA, m=100, c=1e-5) y2 C x2(-1)
What I have done for the variance series are:
Code: Select all
' Some notations explanation:
' lev(1) and lev(2) are the coefficient for the variable residual (<0) for equation 1 and equation 2
' dummy1 is the coefficient for dummy1 in the variance equation of equation 1
' calculate the variance series: H = omega*omega' + beta H(-1) beta' + alpha res(-1) res(-1)' alpha' + lev res(-1;<0) + duminvar dummy1
bvgarch.append var_y1 = omega(1)^2 + beta(1)^2*var_y1(-1) + alpha(1)^2*sqres1(-1) + lev(1)^2*sqres1(-1)*sqresneg1+duminvar(1)^2*dummy1
bvgarch.append var_y2 = omega(3)^2+omega(2)^2 + beta(2)^2*var_y2(-1) + alpha(2)^2*sqres2(-1)+lev(2)^2*sqres1(-1)*sqresneg2
Code: Select all
' bvgarch.append cov_y1y2 = omega(1)*omega(2) + beta(2)*beta(1)*cov_y1y2(-1) + alpha(2)*alpha(1)*res1res2(-1)
