Skip to contents

Pettitt's (1979) test for a single change-point in a time series. Returns the change-point index, the test statistic, and an approximate p-value.

Usage

pettitt_changepoint(series)

Arguments

series

Numeric vector / time series.

Value

Named list with change_point_index, U_max, p_value, note.

References

Pettitt (1979). A non-parametric approach to the change-point problem. J. R. Stat. Soc. C, 28(2), 126–135.

Examples

set.seed(1)
str(pettitt_changepoint(c(rnorm(30), rnorm(30, 2))), max.level = 1)
#> List of 4
#>  $ change_point_index: int 29
#>  $ U_max             : num 854
#>  $ p_value           : num 4.44e-09
#>  $ note              : chr "Pettitt 1979 approximate p-value; single-change-point assumption"