Learn R Programming

spcadjust (version 1.0)

SPCCUSUM-class: CUSUM Charts

Description

Class extending SPCChart with a basic CUSUM charts implementation.

Arguments

Details

The only slot this class contains is the data model. This data model should already incorporate the negative mean for in-control updates that is typical for CUSUM charts.

Let $U_t, t=1,2,\dots$ be the updates from the data model. Then the CUSUM chart is given by $S_0=0$ and $$S_t=max(S_{t-1}+U_t,0)$$

Examples

Run this code
X <-  rnorm(1000)
chart <- new("SPCCUSUM",model=SPCModelNormal(Delta=1))
SPCproperty(data=X,nrep=10,chart=chart,
            property="calARL",params=list(target=100))
SPCproperty(data=X,nrep=10,chart=chart,
            property="calhitprob",params=list(target=0.05,nsteps=1e3))
SPCproperty(data=X,nrep=10,chart=chart,
            property="ARL",params=list(threshold=3))
SPCproperty(data=X,nrep=10,chart=chart,
            property="hitprob",params=list(threshold=3,nsteps=1e3))
#increase the number of repetitions nrep for real applications.

Run the code above in your browser using DataLab