楼主: lucy73
10804 5

[求助]谁熟悉sas中的varmax过程? [推广有奖]

  • 0关注
  • 0粉丝

VIP

讲师

48%

还不是VIP/贵宾

-

威望
0
论坛币
12 个
通用积分
64.7000
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
923 点
帖子
48
精华
0
在线时间
1000 小时
注册时间
2008-1-4
最后登录
2025-12-8

楼主
lucy73 发表于 2009-2-6 15:44:00 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
我想用sas中的varmax过程,但不太会,希望大家给我提供点参考资料或把应用要点给描述一下,谢谢!
二维码

扫码加我 拉你入群

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

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

关键词:varmax ARMAX VARMA ARMA ARM SAS varmax

回帖推荐

本帖被以下文库推荐

沙发
lucy73 发表于 2009-2-10 10:00:00
请好心人帮帮忙!

藤椅
lucy73 发表于 2009-2-16 16:34:00

板凳
maoxinshu 发表于 2009-2-16 17:39:00
请参考SAS/ETS手册

报纸
情迷仲夏夜 发表于 2011-8-1 22:58:54
  1. /* Data 'a' Generated Process */
  2.    proc iml;
  3.       sig = {1.0  0.5, 0.5  1.25};
  4.       phi = {1.2 -0.5, 0.6  0.3};
  5.       call varmasim(y,phi) sigma = sig n = 100 seed = 46859;   
  6.       cn = {'y1' 'y2'};
  7.       create a from y[colname=cn];
  8.       append from y;
  9.    quit;

  10. /* when the series has a linear trend */
  11.    proc varmax data=a;
  12.       model y1 y2 / p=1 trend=linear;
  13.    run;

  14. /* Fit subset of AR order 1 and 3 */
  15.    proc varmax data=a;
  16.       model y1 y2 / p=(1,3);
  17.    run;
  18.    
  19. /* Check if the series is nonstationary */
  20.    proc varmax data=a;
  21.       model y1 y2 / p=1 dftest print=(roots);
  22.    run;
  23.    
  24. /* Fit VAR(1) in differencing */
  25.    proc varmax data=a;
  26.       model y1 y2 / p=1 print=(roots) dify=(1);
  27.    run;
  28.    
  29. /* Fit VAR(1) in seasonal differencing */
  30.    proc varmax data=a;
  31.       model y1 y2 / p=1 dify=(4) lagmax=5;
  32.    run;

  33. /* Fit VAR(1) in both regular and seasonal differencing */
  34.    proc varmax data=a;
  35.       model y1 y2 / p=1 dify=(1,4) lagmax=5;
  36.    run;

  37. /* Fit VAR(1) in different differencing */
  38.    proc varmax data=a;
  39.       model y1 y2 / p=1 dif=(y1(1,4) y2(1)) lagmax=5;
  40.    run;

  41. /* Options related prediction */
  42.    proc varmax data=a;
  43.       model y1 y2 / p=1 lagmax=3
  44.                     print=(impulse covpe(5) decompose(5));
  45.    run;

  46. /* Options related tentative order selection */
  47.    proc varmax data=a;
  48.       model y1 y2 / p=1 lagmax=5 minic
  49.                     print=(parcoef pcancorr pcorr);
  50.    run;

  51. /* Automatic selection of the AR order */
  52.    proc varmax data=a;
  53.       model y1 y2 / minic=(type=aic p=5);
  54.    run;

  55. /* Compare results of LS and Yule-Walker Estimator */
  56.    proc varmax data=a;
  57.       model y1 y2 / p=1 print=(yw);
  58.    run;

  59. /* BVAR(1) of the nonstationary series y1 and y2 */
  60.    proc varmax data=a;
  61.       model y1 y2 / p=1  
  62.          prior=(lambda=1 theta=0.2 ivar nrep=200);
  63.    run;

  64. /* BVAR(1) of the nonstationary series y1 */
  65.    proc varmax data=a;
  66.       model y1 y2 / p=1  
  67.          prior=(lambda=0.1 theta=0.15 ivar=(y1) seed=12345);
  68.    run;

  69. /* Data 'b' Generated Process */
  70.    proc iml;
  71.       sig = { 0.5  0.14 -0.08 -0.03,  0.14 0.71 0.16 0.1,
  72.              -0.08 0.16  0.65  0.23, -0.03 0.1  0.23 0.16};
  73.       sig = sig * 0.0001;
  74.       phi = {1.2 -0.5 0.  0.1,  0.6 0.3 -0.2  0.5,  
  75.              0.4  0. -0.2 0.1, -1.0 0.2  0.7 -0.2};
  76.       call varmasim(y,phi) sigma = sig n = 100 seed = 32567;   
  77.       cn = {'y1' 'y2' 'y3' 'y4'};
  78.       create b from y[colname=cn];
  79.       append from y;
  80.    quit;

  81. /* Cointegration Rank Test using Trace statistics */
  82.    proc varmax data=b;
  83.       model y1-y4 / p=2 lagmax=4 cointtest;
  84.    run;

  85. /* Cointegration Rank Test using Max statistics */
  86.    proc varmax data=b;
  87.       model y1-y4 / p=2 lagmax=4 cointtest=(johansen=(type=max));
  88.    run;

  89. /* Common Trends Test using Filter(Differencing) statistics */
  90.    proc varmax data=b;
  91.       model y1-y4 / p=2 lagmax=4 cointtest=(sw);
  92.    run;

  93. /* Common Trends Test using Filter(Residual) statistics */
  94.    proc varmax data=b;
  95.       model y1-y4 / p=2 lagmax=4 cointtest=(sw=(type=filtres lag=1));
  96.    run;
  97.    
  98. /* Common Trends Test using Kernel statistics */
  99.    proc varmax data=b;
  100.       model y1-y4 / p=2 lagmax=4 cointtest=(sw=(type=kernel lag=1));
  101.    run;

  102. /* Cointegration Rank Test for I(2) */
  103.    proc varmax data=b;
  104.       model y1-y4 / p=2 lagmax=4 cointtest=(johansen=(iorder=2));
  105.    run;
  106.    
  107. /* Fit VECM(2) with rank=3 */
  108.    proc varmax data=b;
  109.       model y1-y4 / p=2 lagmax=4 print=(roots iarr)  
  110.                     ecm=(rank=3 normalize=y1);  
  111.    run;



  112. /* Weak Exogenous Testing for each variable */
  113.    proc varmax data=b outstat=bbb;
  114.       model y1-y4 / p=2 lagmax=4   
  115.                     ecm=(rank=3 normalize=y1);  
  116.       cointeg rank=3 exogeneity;
  117.    run;

  118. /* Hypotheses Testing for long-run and adjustment parameter */
  119.    proc varmax data=b outstat=bbb;
  120.       model y1-y4 / p=2 lagmax=4   
  121.                     ecm=(rank=3 normalize=y1);  
  122.       cointeg rank=3 normalize=y1  
  123.          h=(1 0 0, 0 1 0, -1 0 0, 0 0 1)
  124.          j=(1 0 0, 0 1 0, 0 0 1, 0 0 0);
  125.    run;

  126. /* ordinary regression model */
  127.    proc varmax data=grunfeld;
  128.       model y1 y2 = x1-x3;
  129.    run;

  130. /* Ordinary regression model with subset lagged terms */
  131.    proc varmax data=grunfeld;
  132.       model y1 y2 = x1 / xlag=(1,3);
  133.    run;
  134.    
  135. /* VARX(1,1) with no current time Exogenous Variables */
  136.    proc varmax data=grunfeld;
  137.       model y1 y2 = x1 / p=1 xlag=1 nocurrentx;
  138.    run;

  139. /* VARX(1,1) with different Exogenous Variables */
  140.    proc varmax data=grunfeld;
  141.       model y1 = x3, y2 = x1 x2 / p=1 xlag=1;
  142.    run;
  143.    
  144. /* VARX(1,2) in difference with current Exogenous Variables */
  145.    proc varmax data=grunfeld;
  146.       model y1 y2 = x1 / p=1 xlag=2 difx=(1) dify=(1);
  147.    run;
复制代码
已有 1 人评分经验 论坛币 收起 理由
bakoll + 3 + 3 精彩帖子

总评分: 经验 + 3  论坛币 + 3   查看全部评分

地板
derary66 发表于 2012-11-22 01:30:58
varmax没用过,主要用来解决什么问题的?帮忙扫扫盲吧。

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-9 06:11