Bai Perron

Discussion of models with structural breaks or endogenous switching.
thomas16
Posts: 5
Joined: Tue Oct 05, 2010 10:13 pm

Bai Perron

Unread post by thomas16 »

I am a newbie to RATS, so please be indulgent if the question seems trivial to you. I would appreciate any help though. I am trying to run the Bai Perron multiple structural break test

This is what I have:

Cal(q) 1962
COMPUTE GSTART=1968:01, GEND = 2006:02 ;
all gend

OPEN DATA "/Volumes/PATRIOT/mywork/paper/rats program/dataset.xls"
DATA(FORMAT=XLS,ORG=COLUMNS) 1962:01 2006:03

comp nSeries = 4;

dec vect[series] y(nSeries) ;
set y(1) = 100*log(ydat/ydat{4}) ;
set y(2) = 100*log(x1dat/x1dat{4}) ;
set y(3) = 100*log(x2dat/x2dat{4}) ;
set y(4) = 100*log(x3dat/x3dat{4}) ;

To run the Bai-Perron test do I just add?

@BaiPerron (MAXBREAKS=10) y(1) 1966:01 2003:04
# y(2) y(3) y(4)

If I do that I get the following error message:
## SR10. Missing Values And/Or SMPL Options Leave No Usable Data Points
The Error Occurred At Location 0131 of BAIPERRON
Line 1073744393 of BAIPERRON


My question is whether I am setting the test correctly? I would appreciate if someone can post a sample of codes that will allow me to run the Bai-Perron test. Thanks in advance.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Bai Perron

Unread post by TomDoan »

thomas16 wrote:I am a newbie to RATS, so please be indulgent if the question seems trivial to you. I would appreciate any help though. I am trying to run the Bai Perron multiple structural break test

This is what I have:

Cal(q) 1962
COMPUTE GSTART=1968:01, GEND = 2006:02 ;
all gend

OPEN DATA "/Volumes/PATRIOT/mywork/paper/rats program/dataset.xls"
DATA(FORMAT=XLS,ORG=COLUMNS) 1962:01 2006:03

comp nSeries = 4;

dec vect[series] y(nSeries) ;
set y(1) = 100*log(ydat/ydat{4}) ;
set y(2) = 100*log(x1dat/x1dat{4}) ;
set y(3) = 100*log(x2dat/x2dat{4}) ;
set y(4) = 100*log(x3dat/x3dat{4}) ;

To run the Bai-Perron test do I just add?

@BaiPerron (MAXBREAKS=10) y(1) 1966:01 2003:04
# y(2) y(3) y(4)

If I do that I get the following error message:
## SR10. Missing Values And/Or SMPL Options Leave No Usable Data Points
The Error Occurred At Location 0131 of BAIPERRON
Line 1073744393 of BAIPERRON


My question is whether I am setting the test correctly? I would appreciate if someone can post a sample of codes that will allow me to run the Bai-Perron test. Thanks in advance.

Code: Select all

@BaiPerron (MAXBREAKS=10) y(1) 1966:01 2003:04
# y(2) y(3) y(4)
First off, I'm guessing that you want a CONSTANT in that regression. It isn't included automatically. You also have an extra space before the (MAXBREAKS). So what you probably want is

Code: Select all

@BaiPerron(MAXBREAKS=10) y(1) 1966:01 2003:04
# constant y(2) y(3) y(4)
And, for the future, you don't really need to define a VEC[SERIES] for something like this. Something like

Code: Select all

set ygr   = 100*log(ydat/ydat{4}) ;
set x1gr = 100*log(x1dat/x1dat{4}) ;
set x2gr = 100*log(x2dat/x2dat{4}) ;
set x3gr = 100*log(x3dat/x3dat{4}) ;
@BaiPerron(MAXBREAKS=10) ygr 1966:01 2003:04
# constant x1gr x2gr x3gr
would be a lot easier to both write and read.
thomas16
Posts: 5
Joined: Tue Oct 05, 2010 10:13 pm

Re: Bai Perron

Unread post by thomas16 »

Tom,

thank you very much for all your help. My programs are working now. RATS is giving me the same number of breaks as the BP programI have in GAUSS. One stupid question. In the output file, I can see how many breaks there are but is there a way to find when these break occur? There is nothing in the output. Here is an example of what I have and what I obtain:

Code: Select all

Cal(q) 1962

source(noecho) "/Volumes/PATRIOT/My work/Mortality/rats program/baiperron.src"
*
COMPUTE GSTART=1964:01, GEND = 2006:02 ;
all gend
OPEN DATA "/Volumes/PATRIOT/My work/Mortality/rats program/mortrate_allb.xls"
*CALENDAR(Q) 1962
DATA(FORMAT=XLS,ORG=COLUMNS) 1962:01 2006:03 

SET lMRALL = log(MRALL/MRALL{4})
SET lrgdp = log(rgdp/rgdp{4})
SET lunem = log(unemrate/unemrate{4})
SET con1 = con

@BaiPerron(maxbreaks=6,print,tests) lmrall 1964:01 2004:1
# constant lrgdp

THIS IS MY OUTPUT:


Linear Regression - Estimation by Least Squares
Dependent Variable LMRALL
Quarterly Data From 1964:01 To 2004:01
Usable Observations 161 Degrees of Freedom 159
Centered R**2 0.098447 R Bar **2 0.092777
Uncentered R**2 0.139396 T x R**2 22.443
Mean of Dependent Variable -0.003129877
Std Error of Dependent Variable 0.014393230
Standard Error of Estimate 0.013709303
Sum of Squared Residuals 0.0298832529
Regression F(1,159) 17.3623
Significance Level of F 0.00005056
Log Likelihood 463.19574
Durbin-Watson Statistic 0.663369

Variable Coeff Std Error T-Stat Signif
********************************************************************************
1. Constant -0.009645574 0.001900674 -5.07482 0.00000107
2. LRGDP 0.201625904 0.048388563 4.16681 0.00005056


Breaks RSS BIC LWZ F(m) F(m|m-1)
0 0.029883 -8.53 -8.47
1 0.026836 -8.60 -8.51* 8.97 8.97
2 0.022586 -8.68 -8.50 12.52 14.58
3 0.020819 -8.67 -8.39 11.03 6.45
4 0.018407 -8.70* -8.32 11.61 9.76
5 0.017075 -8.68 -8.21 10.95 5.69
6 0.015560 -8.68 -8.11 10.97 6.96


Linear Regression - Estimation by Least Squares
Dependent Variable LMRALL
Quarterly Data From 1964:01 To 2004:01
Usable Observations 161 Degrees of Freedom 147
Centered R**2 0.530581 R Bar **2 0.489068
Uncentered R**2 0.551903 T x R**2 88.856
Mean of Dependent Variable -0.003129877
Std Error of Dependent Variable 0.014393230
Standard Error of Estimate 0.010288211
Sum of Squared Residuals 0.0155595504
Regression F(13,147) 12.7810
Significance Level of F 0.00000000
Log Likelihood 515.73194
Durbin-Watson Statistic 1.099963

Variable Coeff Std Error T-Stat Signif
********************************************************************************
1. DZ(1,1) -0.005687669 0.065824724 -0.08641 0.93126104
2. DZ(2,1) -0.295516717 1.160890883 -0.25456 0.79941850
3. DZ(1,2) -0.011927564 0.003545922 -3.36374 0.00098070
4. DZ(2,2) 0.288059120 0.077528397 3.71553 0.00028746
5. DZ(1,3) -0.021888347 0.003160077 -6.92652 0.00000000
6. DZ(2,3) 0.198867741 0.076851705 2.58768 0.01063139
7. DZ(1,4) 0.018977326 0.004514162 4.20395 0.00004536
8. DZ(2,4) -0.179465198 0.275330681 -0.65182 0.51553710
9. DZ(1,5) -0.012030273 0.002392268 -5.02882 0.00000142
10. DZ(2,5) 0.358987911 0.062877060 5.70936 0.00000006
11. DZ(1,6) 0.030582215 0.017659595 1.73176 0.08541375
12. DZ(2,6) -0.396193998 0.537890753 -0.73657 0.46255797
13. DZ(1,7) -0.015267397 0.004200913 -3.63430 0.00038462
14. DZ(2,7) 0.335707461 0.124681043 2.69253 0.00791466


1964:04 1974:01 1979:04 1981:02 1993:01 1994:03
Constant -0.005688 -0.011928 -0.021888 0.018977 -0.012030 0.030582 -0.015267
LRGDP -0.295517 0.288059 0.198868 -0.179465 0.358988 -0.396194 0.335707


where are the break dates? Thanks for the help.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Bai Perron

Unread post by TomDoan »

thomas16 wrote:Tom,
1964:04 1974:01 1979:04 1981:02 1993:01 1994:03
Constant -0.005688 -0.011928 -0.021888 0.018977 -0.012030 0.030582 -0.015267
LRGDP -0.295517 0.288059 0.198868 -0.179465 0.358988 -0.396194 0.335707


where are the break dates? Thanks for the help.
The breaks are the 1964:4, 1974:1, etc.
thomas16
Posts: 5
Joined: Tue Oct 05, 2010 10:13 pm

Re: Bai Perron

Unread post by thomas16 »

Tom,

thanks for getting back to me. I think there is something wrong with the Bai-Perron program. If you specify the number of breaks to be say n, it will return n number of breaks. I use the same dataset in Gauss and R and tun the Bai-Perron tests. I get radically different results with RATS. The results in Gauss and R are very close to each other. My codes are included. I can post my data set and the results I found with R and Gauss. Any thoughts? Thank you.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Bai Perron

Unread post by TomDoan »

You can send everything to support@estima.com. Please include the Gauss program and output.
Post Reply