math::changepoint(3tcl) 0.2 math "Tcl Math Library"

Name

math::changepoint - Change point detection methods

Table Of Contents

Synopsis

  • package require Tcl 8.6 9
  • package require TclOO
  • package require math::statistics
  • package require math::changepoint ?0.2?

Description

The math::changepoint package implements a number of well-known methods to determine if a series of data contains a shift in the mean or not. Note that these methods only indicate if a shift in the mean is probably. Due to the stochastic nature of the data that will be analysed, false positives are possible. The CUSUM method is implemented in both an "offline" and an "online" version, so that it can be used either for a complete data series or for detecting changes in data that come in one by one. The implementation has been based on these websites mostly:

Basically, the deviation of the data from a given target value is accumulated and when the total deviation becomes too large, a change point is reported. A second method, binary segmentation, is implemented only as an "offline" method, as it needs to examine the data series as a whole. In the variant contained here the following ideas have been used:

This may not be in agreement with the descriptions of the method found in various publications, but it is simple to understand and intuitive. One publication that provides more information on the method in general is "Selective review of offline change point detection methods" by Truong et al. https://arxiv.org/abs/1801.00718.

PROCEDURES

The package defines the following public procedures:

::math::changepoint::cusum-detect data ?args?

Examine a given data series and return the location of the first change (if any)

double data

Series of data to be examined

lis