Learn R Programming

RegimeChange (version 0.1.1)

compare_methods: Compare Multiple Detection Methods

Description

Runs multiple detection methods on the same data and compares results.

Usage

compare_methods(
  data,
  methods = c("pelt", "binseg", "wbs", "bocpd"),
  true_changepoints = NULL,
  tolerance = 5,
  ...
)

Value

Object of class "regime_comparison"

Arguments

data

Numeric vector or matrix

methods

Character vector of method names

true_changepoints

Vector of true changepoints (for evaluation)

tolerance

Tolerance for evaluation metrics

...

Additional arguments passed to detect_regimes

Examples

Run this code
true_cp <- c(50, 100)
data <- c(rnorm(50), rnorm(50, mean = 2), rnorm(50))

comparison <- compare_methods(
  data,
  methods = c("pelt", "binseg"),
  true_changepoints = true_cp
)

Run the code above in your browser using DataLab