Learn R Programming

RegimeChange (version 0.1.1)

shiryaev_roberts: Shiryaev-Roberts Changepoint Detection

Description

Implements the Shiryaev-Roberts procedure, which is asymptotically optimal for detecting changes with minimal detection delay.

Usage

shiryaev_roberts(
  data,
  type = "mean",
  prior = NULL,
  hazard = NULL,
  threshold = 100,
  mu0 = NULL,
  mu1 = NULL,
  sigma = NULL,
  ...
)

Value

List with changepoints and statistics

Arguments

data

Numeric vector

type

Type of change to detect

prior

Prior specification

hazard

Hazard prior

threshold

Detection threshold

mu0

Pre-change mean (if known)

mu1

Post-change mean (if known)

sigma

Known standard deviation (if applicable)

...

Additional arguments

References

Shiryaev, A. N. (1963). On Optimum Methods in Quickest Detection Problems. Theory of Probability and Its Applications.

Examples

Run this code
data <- c(rnorm(100), rnorm(100, mean = 1))
result <- shiryaev_roberts(data)

Run the code above in your browser using DataLab