lu = &var2;
lh = &var2;
do i= -500 to &nobs ;
/* GARCH(1,1) with normally distributed residuals */
h = &arch0 + &arch1*lu**2 + &garch1*lh;
u = sqrt(h) * rannor(12345) ;
y = &intercept + u;
lu = u;
lh = h;
if i > 0 then output;
proc autoreg data = normal ;
/* Estimate GARCH(1,1) with normally distributed residuals with AUTOREG*/
model y = / garch = ( q=1,p=1 ) ;
output out = normal p = pred r = resid cev = vhat;
/* Estimate GARCH(1,1) with normally distributed residuals with MODEL*/
proc model data = normal ;
/* mean model */
y = intercept ;
/* variance model */
h.y = arch0 + arch1*xlag(resid.y**2,mse.y) +
/* fit the model */
fit y / method = marquardt outall outest = ests out = NORMALB fiml ; ;
When I look at the Residuals in NORMALB, they do not appear to make sense. So, I was expecting RESIDUAL to equal PREDICTED - EXPECTED = 0.479 - -1.035 = 1.51 vs the output in NORMALB = -0.864. Where does this value come from?
Also, the PROC AUTOREG model has a nice output parameter cev = zzz which outputs the volatility estimate - is there an equivalend method of extracting volatility estimates from the PROC MODEL h.zzz model for variance.
I need to use the PROC MODEL approach rather than PROC AUTOREG as PROC MODEL allows more exotic GARCH models than PROC AUTOREG.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.