BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi,
I am trying to implement various GARCH models using the PROC model statement, but having problems.

I am comparing the results from some examples provided in SAS Support:

rsubmit;


%let df = 7.5;
%let sig1 = 1;
%let sig2 = 0.1 ;
%let var2 = 2.5;
%let nobs = 1000 ;
%let nobs2 = 2000 ;
%let arch0 = 0.1 ;
%let arch1 = 0.2 ;
%let garch1 = 0.75 ;
%let intercept = 0.5 ;

data normal;
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;
end;
run;

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;

run ;
quit ;


/* 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) +
garch1*xlag(h.y,mse.y) ;
/* fit the model */
fit y / method = marquardt outall outest = ests out = NORMALB fiml ; ;
run ;
quit ;
endrsubmit;

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.

Hope somebody can help.
Thanks!
2 REPLIES 2
anais
Calcite | Level 5

Hey,

I would like to use the proc model for estimating a garch model, but I don't know how to extract the volatility estimated.

DO you find the solution to extract the volatility with this procedure?

Thanks a lot,

Anaïs

matdotzhou
Calcite | Level 5

As for the cev, I think there is an easy way to get. Under PROC MODEL, in FIT statement, check "OUTRESID":

"...If the h.var equation is specified, the residual values written to the OUT= data set are the normalized residuals, defined as , divided by the square root of the h.var value..."

note that H.name variable specifies the functional form for the variance of the named equation


That means that you can derive h.var (cev) by using actual, predicted, and residual outputs.

Hope helpful.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 1584 views
  • 0 likes
  • 3 in conversation