The following code (1) downloads McDonald's stock prices from July 5, 1966 to November 1, 2021, (2) computes its percent returns, and (3) estimates the GARCH(1,1) model.
filename mcd url 'https://query1.finance.yahoo.com/v7/finance/download/
mcd?period1=-999999999&period2=9999999999';
proc import file=mcd dbms=csv replace out=mcd;
run;
proc expand out=mcd;
id date;
convert adj_close=return/tout=(pctdif);
run;
proc autoreg;
model return=/garch=(q=1,p=1);
output ht=variance out=mcd;
run;Because ARCH1+GARCH1=0.0485+0.9539=1.0024>1, the unconditional variance is undefined. However, the output data set assigns 3.8592488163 as the variance of the first observation—how does AUTOREG compute this value of 3.8592488163 here? It seems this is not documented in The AUTOREG Procedure.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.