cpp_detectCUSUMMeanSingle: Find the first changepoint in the mean using CUSUM

View source: R/RcppExports.R

cpp_detectCUSUMMeanSingleR Documentation

Find the first changepoint in the mean using CUSUM

Description

Given a vector x, control parameters k and h, and a burn-in length BL, returns a list containing the changepoints. Algorithm is implemented in 'C++'.

Usage

cpp_detectCUSUMMeanSingle(x, k, h, BL)

Arguments

x

Vector of numeric values values.

k

control parameter for CUSUM

h

control parameter for CUSUM

BL

Value for the burn-in length.

Details

'CUSUM' updates via:

S_{j} = \max{0, S_{j-1} + (x_{j} - \mu)/ \sigma - k}

where \mu and \sigma are, respectively, the mean and variance of the in-control stream, x_j is the observation at time j and k is a control parameter for CUSUM. Then, a change is signalled if S_j > h, where h is the other control parameter. This is the formulation for using 'CUSUM' to detect an increase in the mean; there is a similar formulation for detecting a decrease, and usually 'CUSUM' is two-sided (monitors for an increase and a decrease in the mean).

Value

A list with

tauhat

A vector of the changepoints found.


ffstream documentation built on May 31, 2023, 7:53 p.m.