Learn R Programming

ffstream (version 0.1.7.2)

cpp_detectEWMAMeanSinglePrechange: Find the first changepoint in the mean using EWMA, assuming prechange known

Description

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

Usage

cpp_detectEWMAMeanSinglePrechange(x, r, L, prechangeMean, prechangeSigma)

Value

A list with

tauhat

A vector of the changepoints found.

Arguments

x

Vector of numeric values values.

r

control parameter for EWMA. Must be in range \([0,1]\).

L

control parameter for EWMA.

BL

Value for the burn-in length.

Details

'EWMA' updates via: $$Z_{j} = (1-r) Z_{j-1} + r x_{j}$$ where \(\mu\) is the mean of the in-control stream, \(x_j\) is the observation at time \(j\) and \(r\) is a control parameter for EWMA. Then, a change is signalled if $$|Z_j - \mu| > L \sigma_{Z_j}$$, where \(L\) is the other control parameter, and \(\sigma_{Z_j}\) is a scaled version of the in-control variance \(\sigma\). This is the formulation for using 'EWMA' to detect an increase or decrease in the mean.