Learn R Programming

RegimeChange (version 0.1.1)

cpc_detect: Contrastive Predictive Coding for Changepoint Detection

Description

Uses self-supervised contrastive learning to detect changepoints by identifying where the learned representations change significantly.

Usage

cpc_detect(
  data,
  window_size = 64,
  encoding_dim = 32,
  n_negative = 10,
  prediction_steps = 5,
  epochs = 100,
  threshold = NULL,
  verbose = FALSE
)

Value

List with changepoints and learned encodings

Arguments

data

Numeric vector

window_size

Window size (default: 64)

encoding_dim

Encoding dimension (default: 32)

n_negative

Number of negative samples (default: 10)

prediction_steps

Future steps to predict (default: 5)

epochs

Training epochs (default: 100)

threshold

Detection threshold for representation distance

verbose

Show progress

References

Oord, A. v. d., Li, Y., and Vinyals, O. (2018). Representation Learning with Contrastive Predictive Coding