Learn R Programming

RegimeChange (version 0.1.1)

crops_detect: CROPS - Changepoints for a Range of Penalties

Description

Efficiently computes optimal segmentations for a range of penalty values, useful for model selection.

Usage

crops_detect(
  data,
  penalty_range = c(0.1, 100),
  method = "pelt",
  min_segment = 2
)

Value

List with:

penalties

Penalty values tested

n_changepoints

Number of changepoints for each penalty

changepoints

List of changepoint vectors

costs

Optimal costs

Arguments

data

Numeric vector

penalty_range

Vector of length 2: c(min_penalty, max_penalty)

method

Segmentation method ("pelt" or "fpop")

min_segment

Minimum segment length

References

Haynes, K., Eckley, I. A., and Fearnhead, P. (2017). Computationally efficient changepoint detection for a range of penalties. Journal of Computational and Graphical Statistics, 26(1), 134-143.