全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
3277 0
2013-10-06
Here is a way to use nlmixed procedure to estimate arma(1,1) and garch(1,1) model.

data sim;
  seed=123;
  lu = 0;
  lh = 0;
  ly = 0;
  do i = 1 to 500;
    h = 0.3 + 0.4 * lu ** 2 + 0.5 * lh;
    u = sqrt(h) * rannor(seed);
    y = 1 + 0.6 * (ly - 1) + u - 0.7 * lu;
    lu = u;
    lh = h;
    ly = y;
    output;
  end;
run;

   proc nlmixed data = sim ;
       /* error mean model */
   parms ar1=0.1 ma1=0.1 mu arch0 arch1 garch1=0.1;
       err=y- (mu + ar1*xlag(y-mu, 0) - ma1 * xlag(err, 0));

       /* variance model */
       h = arch0 + arch1*xlag(err**2,1) +
             garch1*xlag(h,1) ;
       loglik=-0.5*(log(2*constant('pi'))+log(h)+err**2/h);
      model err ~ general (loglik) ;
      estimate 'test mu=1' mu-1;
      estimate 'test ar1= 0.6' ar1-0.6;
      estimate 'test am1= 0.7' ma1-0.7;
      estimate 'test arch0= 0.3' arch0-0.3;
      estimate 'test arch1= 0.4' arch1-0.4;
      estimate 'test garch1= 0.5' garch1-0.5;

run;
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群