[R] Break Points
Ayanendu Sanyal
ayanendu1 at gmail.com
Sat Dec 31 16:09:10 CET 2011
Respected Sir
Thank You for the ultra fast reply.... I changed the file and defined
my data as time series and then ran 'strucchange'.... i have attached
the lastsave1.txt file..... but the lines (ci.ayan) is not working....
Is the work ok???? please confirm .... I am not so much familar with
this test... This time it didnt gave any warning message.
Ayan
On Sat, Dec 31, 2011 at 2:45 AM, Achim Zeileis <Achim.Zeileis at uibk.ac.at> wrote:
> On Fri, 30 Dec 2011, Ayanendu Sanyal wrote:
>
>> Respected Sir
>>
>> I tried the strucchange
>> My data is attached. However I tried the attached commands (last
>> save.txt) to perform Bai Perron 2003... I t worked well but in the end
>> it is giving warning that overlapping confidence interval... I am not
>> sure how to proceed... Please Help Me
>
>
> Overlapping confidence intervals typically indicate that too many
> breakpoints were selected and/or the model does not fit well. In your case,
> the BIC selection is probably not the best solution.
>
> hth,
>
> Z
>
>> Thanking You
>> Ayanendu Sanyal
>>
>> --
>> Please have a look at our new mission and contribute into it (cut and
>> paste the link below in the address bar of your internet browser)
>>
>> http://thesocialscienceinformer.blogspot.com/
>>
>> Thanking you
>>
>> Ayanendu Sanyal
>> PhD Scholar
>> Institute for Social and Economic Change (ISEC)
>> P.O- Nagarbhavi
>> Bangalore-72
>> State- Karnataka
>> Country- India
>> PIN- 560072
>>
>> www.isec.ac.in/phd.html
>>
>> http://ayanendusanyal.blogspot.com/
>>
>
--
Please have a look at our new mission and contribute into it (cut and
paste the link below in the address bar of your internet browser)
http://thesocialscienceinformer.blogspot.com/
Thanking you
Ayanendu Sanyal
PhD Scholar
Institute for Social and Economic Change (ISEC)
P.O- Nagarbhavi
Bangalore-72
State- Karnataka
Country- India
PIN- 560072
www.isec.ac.in/phd.html
http://ayanendusanyal.blogspot.com/
-------------- next part --------------
R version 2.14.1 (2011-12-22)
Copyright (C) 2011 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i386-pc-mingw32/i386 (32-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
Natural language support but running in an English locale
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(strucchange)
Loading required package: zoo
Attaching package: ?zoo?
The following object(s) are masked from ?package:base?:
as.Date, as.Date.numeric
Loading required package: sandwich
> ayan <- read.table("ayan.txt", header=T)
> ayan
lnrpe
1 1.611352
2 1.619602
3 1.599889
4 1.645955
5 1.723777
6 1.830606
7 2.034751
8 2.112377
9 2.095051
10 2.046823
11 2.276628
12 2.543865
13 2.619426
14 2.717786
15 2.874537
16 2.923224
17 3.136825
18 3.206378
19 3.352655
20 3.490328
21 3.508603
22 3.621768
23 3.803617
24 4.141727
25 4.274712
26 4.345235
27 4.242555
28 4.262047
29 4.378895
30 4.419018
31 4.391497
32 4.489015
33 4.588181
34 4.846862
35 5.069645
36 5.257766
37 5.292695
38 5.307845
39 5.277006
40 5.323614
41 5.377629
42 5.429256
43 5.443411
44 5.472426
45 5.727393
46 6.147055
> ayan= ts(ayan, start=1.611352)
> ayan
Time Series:
Start = 1.611352
End = 46.61135
Frequency = 1
lnrpe
[1,] 1.611352
[2,] 1.619602
[3,] 1.599889
[4,] 1.645955
[5,] 1.723777
[6,] 1.830606
[7,] 2.034751
[8,] 2.112377
[9,] 2.095051
[10,] 2.046823
[11,] 2.276628
[12,] 2.543865
[13,] 2.619426
[14,] 2.717786
[15,] 2.874537
[16,] 2.923224
[17,] 3.136825
[18,] 3.206378
[19,] 3.352655
[20,] 3.490328
[21,] 3.508603
[22,] 3.621768
[23,] 3.803617
[24,] 4.141727
[25,] 4.274712
[26,] 4.345235
[27,] 4.242555
[28,] 4.262047
[29,] 4.378895
[30,] 4.419018
[31,] 4.391497
[32,] 4.489015
[33,] 4.588181
[34,] 4.846862
[35,] 5.069645
[36,] 5.257766
[37,] 5.292695
[38,] 5.307845
[39,] 5.277006
[40,] 5.323614
[41,] 5.377629
[42,] 5.429256
[43,] 5.443411
[44,] 5.472426
[45,] 5.727393
[46,] 6.147055
> bp.ayan <- breakpoints(ayan ~ 1)
> summary (bp.ayan)
Optimal (m+1)-segment partition:
Call:
breakpoints.formula(formula = ayan ~ 1)
Breakpoints at observation number:
m = 1 22
m = 2 16 33
m = 3 11 22 34
m = 4 10 16 23 34
m = 5 10 16 23 33 40
m = 6 6 12 18 24 33 40
Corresponding to breakdates:
m = 1 22.611352
m = 2 16.611352 33.611352
m = 3 11.611352 22.611352 34.611352
m = 4 10.611352 16.611352 23.611352 34.611352
m = 5 10.611352 16.611352 23.611352 33.611352 40.611352
m = 6 6.611352 12.611352 18.611352 24.611352 33.611352 40.611352
Fit:
m 0 1 2 3 4 5
RSS 85.184802 18.716087 8.291525 3.576609 2.244549 1.809104
BIC 166.543984 104.491043 74.697447 43.677063 29.902475 27.638800
m 6
RSS 1.617595
BIC 30.149073
> ci.ayan <- confint(bp.ayan)
> ci.ayan
Confidence intervals for breakpoints
of optimal 6-segment partition:
Call:
confint.breakpointsfull(object = bp.ayan)
Breakpoints at observation number:
2.5 % breakpoints 97.5 %
1 9 10 11
2 15 16 17
3 22 23 24
4 32 33 34
5 34 40 42
Corresponding to breakdates:
2.5 % breakpoints 97.5 %
1 9.611352 10.61135 11.61135
2 15.611352 16.61135 17.61135
3 22.611352 23.61135 24.61135
4 32.611352 33.61135 34.61135
5 34.611352 40.61135 42.61135
> lines(ci.ayan)
Error in int_abline(a = a, b = b, h = h, v = v, untf = untf, ...) :
plot.new has not been called yet
> plot (ayan)
> ayan <- read.table("ayan.txt", header=T)
> ayan= ts(ayan, start=1.611352)
> bp.ayan <- breakpoints(ayan ~ 1)
> summary (bp.ayan)
Optimal (m+1)-segment partition:
Call:
breakpoints.formula(formula = ayan ~ 1)
Breakpoints at observation number:
m = 1 22
m = 2 16 33
m = 3 11 22 34
m = 4 10 16 23 34
m = 5 10 16 23 33 40
m = 6 6 12 18 24 33 40
Corresponding to breakdates:
m = 1 22.611352
m = 2 16.611352 33.611352
m = 3 11.611352 22.611352 34.611352
m = 4 10.611352 16.611352 23.611352 34.611352
m = 5 10.611352 16.611352 23.611352 33.611352 40.611352
m = 6 6.611352 12.611352 18.611352 24.611352 33.611352 40.611352
Fit:
m 0 1 2 3 4 5
RSS 85.184802 18.716087 8.291525 3.576609 2.244549 1.809104
BIC 166.543984 104.491043 74.697447 43.677063 29.902475 27.638800
m 6
RSS 1.617595
BIC 30.149073
> ci.ayan <- confint(bp.ayan)
> ci.ayan
Confidence intervals for breakpoints
of optimal 6-segment partition:
Call:
confint.breakpointsfull(object = bp.ayan)
Breakpoints at observation number:
2.5 % breakpoints 97.5 %
1 9 10 11
2 15 16 17
3 22 23 24
4 32 33 34
5 34 40 42
Corresponding to breakdates:
2.5 % breakpoints 97.5 %
1 9.611352 10.61135 11.61135
2 15.611352 16.61135 17.61135
3 22.611352 23.61135 24.61135
4 32.611352 33.61135 34.61135
5 34.611352 40.61135 42.61135
>
-------------- next part --------------
lnrpe
1.6113515
1.619601724
1.599889264
1.645954835
1.723777317
1.830606002
2.034751407
2.112377045
2.095050993
2.046822835
2.276628064
2.543864584
2.619425807
2.717786454
2.874537082
2.923223972
3.136825311
3.206377996
3.352655132
3.49032806
3.508602739
3.621768106
3.803617305
4.141727497
4.27471221
4.34523451
4.242555261
4.262046942
4.378894917
4.419018243
4.391496862
4.489015146
4.588180885
4.846861554
5.069645376
5.257766481
5.292695491
5.307844982
5.277006289
5.323613873
5.377629069
5.429256311
5.443411354
5.47242567
5.727392687
6.147054773
More information about the R-help
mailing list