Skip to contents

A piecewise-constant signal with regularly spaced changepoints.

Usage

signal_teeth(n = 2000, seed = NULL)

Arguments

n

Length of the signal. Defaults to 2000.

seed

Optional seed.

Value

A tibble with columns index and value.

Examples

x <- signal_teeth(n = 600, seed = 2026)
attr(x, "true_changepoints")   # a change every 100 observations
#> [1] 100 200 300 400 500
cpt_detect(x$value, method = "pelt")$changepoints$cp
#> [1] 100 200 300 400 500