Introduction to ChangePointTaylor

The ChangePointTaylor package is a simple R implementation of the change in mean detection method developed by Wayne Taylor and utilized in his Change Point Analyzer software. The package recursively uses the ‘MSE’ change point calculation to identify candidate change points. The change points are then re-estimated and Taylor’s backwards elimination process is employed to come up with a final set of change points. Many of the underlying functions are written in C++ for improved performance.

Installation

You can install the released version of ChangePointTaylor from CRAN with:

install.packages("ChangePointTaylor")

Example

Load the package and other needed libraries for this example

View the example dataset of US trade deficit data from January 1987 to December 1988.

Plot the data

In its simplest form, the change_point_analyzer() function simply takes a numeric vector and returns the identified change points. However, the output only identifies changes by their index in the original numeric vector.

When a vector of labels, the same length as the x values, is supplied to the label argument, those labels will be displayed in the output dataframe.

Plot the change points we identified.

The number of bootstraps can be controlled with the n_bootstraps argument. This can reduce stochastic differences between subsequent function calls; however, this comes at the expense of execution speed.

The the user can also adjust the minimum level of confidence a change point must reach to become an initial candidate (min_candidate_conf) and the minimum confidence to be included in the final table of change points (min_tbl_conf).