computeBreakPoints: Structural break detection with rectangles

Description Usage Arguments Value Author(s) Examples

View source: R/computeBreakPoints.R

Description

Find structural breaks by fitting it rectangles to a time series. The algorithm is randomised; it uses a genetic algorithm. Therefore, the break point sequence found can be different in different executions of the method on the same data, especially when used on longer series of some thousand observations.

Usage

1
computeBreakPoints(series,alpha)

Arguments

series

The time series as a vector of doubles.

alpha

A double in the range [0.0;1.0]. Values close to 0 result in more breakpoints, values close to 1 in fewer. With no background knowledge, alpha = 0.25 is a good start value for experiments.

Value

The break points found as a vector of integers. The first entry always is 0 (the first index of the series) the last one is the length of the series (note, indexing starts with 0). The other entries are the indices of the internal break points.

Author(s)

Paul Fischer and Astrid Hilbert

Examples

1
2
3
4
series <- c(1,2,1,2,1,2,5,6,5,6,5,6)
alpha <- 0.25
breaks <- computeBreakPoints(series,alpha)
breaks

Example output

Loading required package: rJava
[1]  0  6 12

SBRect documentation built on May 2, 2019, 11:27 a.m.