楼主: meihao2008
2055 6

Please Help: 谁有VAR的Gauss程序?谢谢! [推广有奖]

  • 0关注
  • 0粉丝

已卖:63份资源

博士生

17%

还不是VIP/贵宾

-

威望
0
论坛币
21570 个
通用积分
8.7099
学术水平
-5 点
热心指数
5 点
信用等级
-5 点
经验
6646 点
帖子
246
精华
0
在线时间
124 小时
注册时间
2005-5-4
最后登录
2022-11-16

楼主
meihao2008 发表于 2010-3-18 01:50:50 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
Please Help: 谁有VAR的Gauss程序?谢谢!网上有Maximo ComachoVAR程序,但是它只对每个变量取一次Lag, 而且没有给出每个系数的Significance. 谁有通用的VAR程序,请给我发一份,万分感谢!
二维码

扫码加我 拉你入群

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

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

关键词:gauss程序 please GAUSS Lease plea VaR 程序 GAUSS

沙发
狂奔的肉夹馍 发表于 2010-3-18 02:44:55
提示: 该帖被管理员或版主屏蔽
签名被屏蔽

藤椅
meihao2008 发表于 2010-3-18 14:32:51
What happened to the 2nd floor?

该帖被管理员或版主屏蔽???

板凳
zhaomn200145 发表于 2010-3-18 15:45:01
meihao2008 发表于 2010-3-18 14:32
What happened to the 2nd floor?

该帖被管理员或版主屏蔽???
那是灌水贴,与你的主题没有任何关系。

报纸
zhaomn200145 发表于 2010-3-18 15:47:54
new;
cls;

@ Here the matrix y (nx1) @

load y[]=y.txt;
load c[]=c.txt;
load i[]=i.txt;
ipi=y~c~i;
n=cols(ipi);
hp=ipi[2:rows(y),.]~ipi[1:rows(y)-1,.];
dly=100*ln(hp[.,1:n]./hp[.,n+1:2*n]);


"";"";"";"";"";"";"";
"**********************************************************************";"";
"                 Choosing the order of the VAR (p)";"";
"   Enter maximun number of lags you want for the model (p.max): ";"";
"**********************************************************************";



@ Some parameters of interest @

pmax=con(1,1);          @ pmax is the maximum lag-length @
n=cols(dly);            @ n is the dimension of the VAR @
nk=pmax+1;              @ nk is the first obs for which
                           OLS is calculated @
capt=rows(dly);         @ capt is the original sample size @
captst=capt-pmax;       @ captst is the effective sample size @
resul=zeros(pmax,4);    @ result will include the AIC, BIC and HQ
                           for each lag p @
ome=zeros(n,n);         @ ome will include the VARCOV matrix @


@ OLS estimate of VARCOV @

p=1;
reg=ones(captst,1);
do until p>pmax;
   err=zeros(captst,n);
   reg=reg~dly[nk-p:capt-p,.];    @ reg is the matrix of
                                       regressors @
   k=n+(n*n*p);                     @ k is the total number of
                                       param. to be estimated @
   i=1;
   do until i>n;
      Dy=dly[nk:capt,i];
      err[.,i]=Dy-reg*inv(reg'reg)*reg'Dy;
      i=i+1;
   endo;
   r=1;
   do until r>n;
      c=1;
      do until c>n;
         den=captst-k;
         ome[r,c]=(1/den)*(err[.,r]'err[.,c]);
         c=c+1;
      endo;
      r=r+1;
   endo;

   aka=ln(det(ome))+(2*(n^2)*p/captst);
   sch=ln(det(ome))+(ln(captst)*(n^2)*p/captst);
   hq=ln(det(ome))+(2*ln(ln(captst))*(n^2)*p/captst);
   resul[p,.]=p~aka~sch~hq;
   p=p+1;
endo;


@ Output files @

output file=AIC.txt reset;
resul[.,2]-1;
output off;

output file=BIC.txt reset;
resul[.,3];
output off;

output file=HQ.txt reset;
resul[.,4]+1;
output off;


@ Results @
cls;
" ";
"            p            Akaike          Schwartz       Hanan & Quinn  ";
resul;
" ";
end;

地板
meihao2008 发表于 2010-3-20 02:05:00
Thank you. zhaomn200145! But the code you provided is for finding the right order of VAR, instead of estimating VAR. I need a code to find the estimates of VAR.

7
xuelida 在职认证  发表于 2010-3-23 22:49:53
http://www.unc.edu/~jbhill/Gauss_by_code.htm
你在这个网站下载吧,上面可能有你需要的V

VAR (maximum likelihood):  Maximo Comacho

VAR Order Selection:  Maximo Comacho

VAR Routines:  David Rapach and Wharff.

VAR (structural):  Paul Fackler.

VAR, VAR restricted, VECM: Luciano Guitierrez.

VARHAC:  Wouter den Haan

Vector ARMA:  Ron Schoenberg.

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

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2026-1-12 04:58