Find structural breaks by fitting it rectangles to a time series. The algorithm is randomised; it uses a genetic algorithms. 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.

1 | ```
computeRectangles(series,alpha)
``` |

`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. |

The rectangles found by the algorithm as a *k \times 4* matrix of doubles.
Each row is of length 4, describing
one rectangle, *R_i =[llx,lly,urx,ury]*, where *(llx,lly)* is the lower left corner of the rectangle
and *(urx,ury)* is the upper right corner.

Paul Fischer and Astrid Hilbert

1 2 3 4 | ```
series <- c(1,2,1,2,1,2,5,6,5,6,5,6)
alpha <- 0.25
rects <- computeRectangles(series,alpha)
rects
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.