Learn R Programming

RegimeChange (version 0.1.1)

tcn_detect: TCN-based Changepoint Detection

Description

Uses Temporal Convolutional Networks with dilated causal convolutions for sequence-to-sequence changepoint prediction.

Usage

tcn_detect(
  data,
  true_changepoints = NULL,
  window_size = 64,
  n_filters = 64,
  kernel_size = 3,
  dilations = c(1, 2, 4, 8, 16),
  dropout = 0.2,
  epochs = 50,
  threshold = 0.5,
  verbose = FALSE
)

Value

List with changepoints, probabilities, and model

Arguments

data

Numeric vector of time series data

true_changepoints

Optional vector of known changepoints for supervised training. If NULL, uses unsupervised approach.

window_size

Size of input window (default: 64)

n_filters

Number of convolutional filters (default: 64)

kernel_size

Kernel size for convolutions (default: 3)

dilations

Dilation rates (default: c(1, 2, 4, 8, 16))

dropout

Dropout rate (default: 0.2)

epochs

Training epochs (default: 50)

threshold

Detection threshold (default: 0.5)

verbose

Show training progress (default: FALSE)

References

Bai, S., Kolter, J. Z., and Koltun, V. (2018). An Empirical Evaluation of Generic Convolutional and Recurrent Networks for Sequence Modeling