Breakdates Corresponding to Breakpoints

Description

A generic function for computing the breakdates corresponding to breakpoints (and their confidence intervals).

Usage

breakdates(obj, format.times = FALSE, ...)

Arguments

obj An object of class “breakpoints”, “breakpointsfull” or their confidence intervals as returned by confint.
format.times logical. If set to TRUE a vector of strings with the formatted breakdates. See details for more information.
currently not used.

Details

Breakpoints are the number of observations that are the last in one segment and breakdates are the corresponding points on the underlying time scale. The breakdates can be formatted which enhances readability in particular for quarterly or monthly time series. For example the breakdate 2002.75 of a monthly time series will be formatted to “2002(10)”.

Value

A vector or matrix containing the breakdates.

See Also

breakpoints, confint

Examples

library("strucchange")

## Nile data with one breakpoint: the annual flows drop in 1898
## because the first Ashwan dam was built
data("Nile")
plot(Nile)

bp.nile <- breakpoints(Nile ~ 1)
summary(bp.nile)

     Optimal (m+1)-segment partition: 

Call:
breakpoints.formula(formula = Nile ~ 1)

Breakpoints at observation number:
                      
m = 1      28         
m = 2      28       83
m = 3      28    68 83
m = 4      28 45 68 83
m = 5   15 30 45 68 83

Corresponding to breakdates:
                                
m = 1        1898               
m = 2        1898           1953
m = 3        1898      1938 1953
m = 4        1898 1915 1938 1953
m = 5   1885 1900 1915 1938 1953

Fit:
                                                   
m   0       1       2       3       4       5      
RSS 2835157 1597457 1552924 1538097 1507888 1659994
BIC    1318    1270    1276    1285    1292    1311
plot(bp.nile)

## compute breakdates corresponding to the
## breakpoints of minimum BIC segmentation
breakdates(bp.nile)
[1] 1898
## confidence intervals
ci.nile <- confint(bp.nile)
breakdates(ci.nile)
  2.5 % breakpoints 97.5 %
1  1895        1898   1902
ci.nile

     Confidence intervals for breakpoints
     of optimal 2-segment partition: 

Call:
confint.breakpointsfull(object = bp.nile)

Breakpoints at observation number:
  2.5 % breakpoints 97.5 %
1    25          28     32

Corresponding to breakdates:
  2.5 % breakpoints 97.5 %
1  1895        1898   1902
plot(Nile)
lines(ci.nile)