楼主: dieme
2483 6

helphelp!这个程序没反应 [推广有奖]

  • 2关注
  • 12粉丝

共和国首席经济学家

已卖:312份资源

学科带头人

14%

还不是VIP/贵宾

-

威望
0
论坛币
1216 个
通用积分
166.7519
学术水平
9 点
热心指数
15 点
信用等级
3 点
经验
12537 点
帖子
939
精华
0
在线时间
2465 小时
注册时间
2008-4-8
最后登录
2025-11-18

楼主
dieme 在职认证  发表于 2009-12-28 20:21:58 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
** This procedure performs Tsay's (1989)
** TAR specification test
** and was written by Ming Chien Lo on July 13, 1999.
**
** Last updated: August 28, 1999.
**
** Input: z T x 1 data series
**
**   p order of the autoregressive process
**   d lag index for threshold variable Y{t-d}
**
** Output: F resulting F-statistics
**   b starting observation index for the recursive regression
**   h starting index of the arranged data set
**
**   (both b & h are for calculation of d.f. in F-test)
*/
proc(3)=tsayuni(z,p,d);
local h, t, oz, ytd, y, x, i, y_, x_, Pm, bm, ym1, xm, xm1, ahat, beta, Dm1, Dm1t, Fd_, Fn_, F,
Km1, Pm1, bm1, b, ehat, ephat, omega, invXX, gs, zx, xtd, x1, yt, xt;
h=maxc(1|(p+1-d)); @ starting index of the arranged data set @
t=rows(z);   @ total no. of observations @
ytd=z[h:t-d];   @ potential threshold @
yt=z[h+d:t];   @ truncated y series @
zx=shiftr(z',seqa(1,1,p),0); @ create independent variable matrix from raw data @
zx=zeros(p,p)|trimr(zx',p,0);
xt=zx[h+d:t,.];   @ trucated x series @
gs=sortind(ytd);  @ index for sorted y{t-d} @
y=yt[gs];    @ arranged Y according to sorted y{t-d} @
x=xt[gs,.];   @ arranged X according to sorted y{t-d} @
b=floor(0.1*t)+p;  @ set starting observation index for the recursive regression @
x=ones(rows(x),1)~x;
@ derive first beta_m for the first m cases according to b @
beta=zeros(t-d-h-b+1,p+1);
Dm1t=zeros(t-d-h-b+1,1);
ahat=zeros(t-d-h-b+1,1);
y_=y[1:b];
x_=x[1:b,.];
Pm=invpd(moment(x_,0));
bm=Pm*x_'y_;
@ recursive regression @
i=1;
do until i>t-d-h-b+1;
ym1=y[b+i];
xm1=x[b+i,.]';
Dm1=1+xm1'*Pm*xm1;
Km1=Pm*xm1/Dm1;
bm1=bm+Km1*(ym1-xm1'*bm);
Pm1=(eye(p+1)-Pm*(xm1*xm1')/Dm1)*Pm;

beta[i,.]=bm1';
Dm1t=Dm1;
ahat=ym1-xm1'*bm;
bm=bm1;
Pm=Pm1;
i=i+1;
endo;
@ calculate F-statistics @
ehat=ahat./sqrt(Dm1t);
x1=x[b+1:rows(x),.];
invXX=invpd(moment(x1,0));
omega=invXX*x1'ehat;
ephat=ehat-x1*omega;
Fn_=(sumc(ehat.*ehat)-sumc(ephat.*ephat))/(p+1);
Fd_=sumc(ephat.*ephat)/(t-d-b-p-h);
F=Fn_/Fd_;
retp(F,b,h);
endp;
二维码

扫码加我 拉你入群

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

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

关键词:helphelp Help elp observations observation 程序 helphelp

tsayuni.rar
下载链接: https://bbs.pinggu.org/a-505931.html

1.11 KB

本附件包括:

  • tsayuni.prc

沙发
xuehe 发表于 2009-12-28 22:16:18
它是程序段,应该被#include tsayuni.prc;
你把完整的程序包找来不?

藤椅
zhaomn200145 发表于 2009-12-29 11:50:20
看不懂楼主什么意思?哪里有问题?

板凳
dieme 在职认证  发表于 2009-12-29 15:16:24
2# xuehe

我是在这里下载的
只有一个啊
http://www.unc.edu/~jbhill/Gauss_by_code.htm
TAR specification test (univariate: Tsay's Test


请版主大人看一下

报纸
xuehe 发表于 2009-12-29 17:33:40
mcbalke2中的prc等都在压缩文件中,但mcbalke中的urvstab2.g; @ Berben-Van Dijk 3-regime Test @等找不到,给个链接需要懂德语,找到后请上传。
http://faculty.washington.edu/ezivot/gaussfaq.htm

http://www.eur.nl/ese/

montec.rar

13.37 KB

others.zip

3.64 KB

本附件包括:

  • table67.prg
  • getcity.prc
  • getdata.prc

lozivot1.zip

271.25 KB

本附件包括:

  • tvecm3.zip
  • tar3.zip
  • README.doc
  • data.zip
  • montec.zip
  • others.zip

data.zip

229.38 KB

本附件包括:

  • se63.txt
  • SA111211.txt
  • sa1113.txt
  • SA11141.txt
  • SA11142.txt
  • SA1115.txt
  • SA2112.txt
  • sa213.txt
  • sa221.txt
  • sa2313.txt
  • sa3111.txt
  • sa3112.txt
  • sa3114.txt
  • sa415.txt
  • sa51.txt
  • sa61.txt
  • sa712.txt
  • sa713.txt
  • se06.txt
  • se07.txt
  • se08.txt
  • se19.txt
  • se20.txt
  • se2101.txt
  • se22.txt
  • se27.txt
  • se28.txt
  • se29.txt
  • se32.txt
  • se33.txt
  • se34.txt
  • se40.txt
  • se41.txt
  • se44.txt
  • se45.txt
  • se46.txt
  • se4701.txt
  • se49.txt
  • se53.txt
  • se56.txt
  • se57.txt
  • se62.txt
  • SA1111.txt
  • ddata.xls
  • city.doc

tar3.zip

8.12 KB

本附件包括:

  • ginv.prc
  • dinv.prc
  • ar_sim.prc
  • tar3.prg
  • qfunc.prc
  • qsort.prc
  • qsort_2.prc
  • tar.prc
  • tar_d.prc
  • tar3.prc
  • tar31.prc
  • tar3bai.prc

tvecm3.zip

12.32 KB

本附件包括:

  • tvecm3.prg
  • tvecm3.prc
  • vtarbot3.prc
  • EcmToVar.prc
  • ginv.prc
  • qfuncv.prc
  • qsort.prc
  • qsort_2.prc
  • simvar.prc
  • simvecmk.prc
  • tr.prc
  • tvecm31.prc
  • varlags.prc
  • vtar.prc
  • vtar_d.prc
  • vtar3bai.prc
  • dinv.prc

地板
xuelida 在职认证  发表于 2009-12-29 20:35:58
不错的

7
zhaomn200145 发表于 2010-1-3 11:34:42
以前倒是学过一年的德语,可惜早都还给老师了,呵呵。

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

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2025-12-30 03:47