楼主: 大头剑客
8215 27

[问答] BAI and PERRON的结构突变程序求教~ [推广有奖]

  • 0关注
  • 0粉丝

高中生

65%

还不是VIP/贵宾

-

威望
0
论坛币
-2 个
通用积分
0
学术水平
1 点
热心指数
1 点
信用等级
1 点
经验
5554 点
帖子
10
精华
0
在线时间
55 小时
注册时间
2011-2-26
最后登录
2014-2-22

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
最近在研究BAI and PERRON(2003)的文章中的结构突变的程序,现在我有一个上证指数序列,我想检验AR(1)过程的系数的突变。参数设置如下:bigt=4728;                        @set effective sample size@
y=yyy[1:4728,2];                @set up the data, y is the dependent variable
                                z is the matrix of regressors (bigt,q) whose
                                coefficients are allowed to change, x is a
                                (bigt,p) matrix of regressors with coefficients
                                fixed across regimes. Note: initialize x to
                                something, say 0, even if p = 0.@
z=yyy[1:4728,3];

x=0;

q=1;                         @number of regressors z@
p=0;                         @number of regressors x@
m=5;                         @maximum number of structural changes allowed@
eps1=.15;                  @Value of the trimming (in percentage) for the construction
                                  and critical values of the supF ype tests (used in the
                                 supF test, the Dmax, the supF(l+1|l) and the sequential
                                  procedure). If these test are used, h below should be set
                                  at int(eps1*bigt). But if the tests are not required, estimation
                                  can be done with an arbitrary h.
                                  There are five options: eps1 = .05, .10, .15, .20 or .25.
                                  For each option, the maximal value of m above is: 10 for eps1 = .05;
                                  8 for eps1 = .10, 5 for eps1 = .15, 3 for eps1 = .20 and 2 for eps1 = .25.@
h=int(eps1*bigt);                         @minimal length of a segment (h >= q). Note: If
                                  robust=1, h should be set at a larger value.@
/* the following are options if p > 0.
----------------------------------- */
fixb=0;                     @set to 1 if use fixed initial values for beta@
betaini=0;                  @if fixb=1, load the initial value of beta.@
maxi=20;                    @maximum number of iterations for the nonlinear
                             procedure to obtain global minimizers.@
printd=1;                   @set to 1 if want the output from the iterations
                             to be printed.@
eps=0.0001;                 @criterion for the convergence.@
/*--------------------------------- */

robust=0;                   @set to 1 if want to allow for heterogeneity
                             and autocorrelation the in residuals, 0 otherwise.
                             The method used is Andrews(1991) automatic
                             bandwidth with AR(1) approximation and the
                             quadratic quernel. Note: Do not set to 1 if
                             lagged dependent variables are included as
                             regressors.@
prewhit=1;                   @set to 1 if want to apply AR(1) prewhitening
                              prior to estimating the long run covariance
                              matrix@
hetdat=1;              @Option for the construction of the F-tests.
                                Set to 1 if want to allow different moment matrices of the
                               regressors accross segments. If hetdat = 0, the same
                               moment matrices are assumed for each segment and estimated
                               from the full sample. It is recommended to set hetdat=1.  If p > 0
                                set hetdat = 1.@
hetvar=1;              @Option for the construction of the F-tests.
                              Set to 1 if want to allow for the variance of the residuals
                              to be different across segments. If hetvar=0, the variance
                               of the residuals is assumed constant across segments
                              and constructed from the full sample. This option is not available
                              when robust = 1.@
hetomega=1;                @Used in the construction of the confidence
                            intervals for the break dates. If hetomega=0,
                            the long run covariance matrix of zu is assumed
                            identical accross segments (the variance of the
                            errors u if robust = 0).@
hetq=1;                    @Used in the construction of the confidence
                            intervals for the break dates. If hetq=0,
                            the moment matrix of the data is assumed
                            identical accross segments.@
doglobal=1;                 @set to 1 if want to call the procedure
                             to obtain global minimizers.@
dotest=1;                   @set to 1 if want to construct the sup F,
                             UDmax and WDmax tests. doglobal must be set
                             to 1 to run this procedure.@
dospflp1=1;                 @set to 1 if want to construct the sup(l+1|l)
                             tests where under the null the l breaks are
                             obtained using global minimizers. doglobal
                             must be set to 1 to run this procedure.@
doorder=1;                  @set to 1 if want to call the procedure that
                             selects the number of breaks using information
                             criteria. doglobal must be set to 1 to run
                             this procedure.@
dosequa=1;                  @set to 1 if want to estimate the breaks
                             sequentially and estimate the number of
                             breaks using the supF(l+1|l) test.@
dorepart=1;                @set to 1 if want to modify the
                             break dates obtained from the sequential
                             method using the repartition method of
                             Bai (1995), Estimating breaks one at a time.
                             This is needed for the confidence intervals
                             obtained with estim below to be valid.@
estimbic=1;                  @set to 1 if want to estimate the model with
                              the number of breaks selected by BIC.@
estimlwz=0;                  @set to 1 if want to estimate the model with
                              the number of breaks selected by LWZ.@
estimseq=1;                 @set to 1 if want to estimate the model with
                              the number of breaks selected using the
                              sequential procedure.@
estimrep=0;                 @set to 1 if want to esimate the model with
                              the breaks selected using the repartition
                              method.@
estimfix=0;                  @set to 1 if want to estimate the model with
                              a prespecified number of breaks equal to fixn
                              set below.@
fixn=0;

call pbreak(bigt,y,z,q,m,h,eps1,robust,prewhit,hetomega,
hetq,doglobal,dotest,dospflp1,doorder,dosequa,dorepart,estimbic,estimlwz,
estimseq,estimrep,estimfix,fixb,x,q,eps,maxi,fixb,betaini,printd,hetdat,hetvar,fixn);

#include C:\Users\LZ\Desktop\break\brcode.src            @set the path to where you store the file brcode.src@

end;


我就是把前面的参数改成自己的数据的,读取的excel中的第一列是时间,第二列是上证指数,第三列是滞后一期的上证指数,共4728个观测。
运行结果只有突变点的位置,运行到F检验的时候就出错,提示是brcode.src的76行pftest出错,我不知道怎么回事,应该是要将原程序或者参数改一下,还请研究过的前辈指教。谢谢

二维码

扫码加我 拉你入群

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

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

关键词:Perron 结构突变 err Construction coefficients 程序

沙发
xuelida 在职认证  发表于 2013-6-11 08:58:37 |只看作者 |坛友微信交流群
你用其他方法做

使用道具

藤椅
大头剑客 发表于 2013-6-11 15:41:06 |只看作者 |坛友微信交流群
xuelida 发表于 2013-6-11 08:58
你用其他方法做
其他方法是指什么,不用BP的方法了?

使用道具

板凳
tracy272523 在职认证  发表于 2013-7-27 15:48:32 |只看作者 |坛友微信交流群
你好,能不能发一个bai和perron的程序包给我呀,十分感谢

使用道具

报纸
大头剑客 发表于 2013-7-28 14:56:45 |只看作者 |坛友微信交流群
tracy272523 发表于 2013-7-27 15:48
你好,能不能发一个bai和perron的程序包给我呀,十分感谢
好的,留个邮箱

使用道具

地板
tracy272523 在职认证  发表于 2013-7-29 11:16:40 |只看作者 |坛友微信交流群
大头剑客 发表于 2013-7-28 14:56
好的,留个邮箱
116510776@qq.com,谢谢啦

使用道具

7
大头剑客 发表于 2013-7-29 21:48:50 |只看作者 |坛友微信交流群
tracy272523 发表于 2013-7-29 11:16
,谢谢啦
已发

使用道具

8
tracy272523 在职认证  发表于 2013-7-29 21:53:45 |只看作者 |坛友微信交流群
大头剑客 发表于 2013-7-29 21:48
已发
大好人呀

使用道具

9
DAI0516YI 发表于 2014-9-15 12:00:19 |只看作者 |坛友微信交流群
求大神赐教bai和perron的程序包~~~~xiaoyi0516@sina.cn

使用道具

10
DAI0516YI 发表于 2014-9-15 12:58:07 |只看作者 |坛友微信交流群
大头剑客 发表于 2013-7-28 14:56
好的,留个邮箱
求大神赐教bai和perron的程序包~~~~xiaoyi0516@sina.cn

使用道具

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

本版微信群
加好友,备注jltj
拉您入交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-4-25 13:00