I have been given 4 equations and have been told i have to generate data for a Garch-m series. I am have a lot of trouble trying to generate this series. The equations i have are:
y_t = 2.0+3.0*x_t+0.8*(h_t)**0.5+e_t,
z_t=%RAN(1) ,
v_t=%RAN(1) ,
x_t=1.0+0.6*x_t-1+z_t ,
h_t=1.0+0.4*(e_t-1)**2+0.3*h_t-1
and e_t=v_t*((h_t)**0.5).
So far this is the code i have been working on but it keeps coming up with errors
[
Code: Select all
nonlin alpha0 alpha1 alpha2 alpha3 alpha4 alpha5 alpha6 alpha7
frml eq1 y =alpha0+(alpha1*x_t)+(alpha2*(h_t)**0.5)+e_t
compute z=%RAN(1)
compute v=%RAN(1)
compute alpha0=2.0
compute alpha1=3.0
compute alpha2=0.8
compute aplha3=1.0
compute alpha4=0.6
compute alpha5=1.0
compute alpha6=0.4
compute alpha7=0.3
compute x_t=alpha3+alpha4*(x_t-1)+z_t
compute h_t=alpha5+alpha6*(e_t-1)**2+alpha7*(h_t-1)
compute e_t=v_t*(h_t)**0.5
nlls(frml = eq1) y_t 1 500 residuals
Cheers