XtToCt: Convert from Data to FSI CUSUM Statistic

Description Usage Arguments Details Value Examples

View source: R/attrCUSUM_getxxx_and_utils.R

Description

Conversion of data to FSI CUSUM statistic for monitoring of mean increase.

Usage

1
XtToCt(Xt, refv, c.zero = 0, maxndec = 7L)

Arguments

Xt

A non-negative integer-valued vector of count process of interest.

refv

A reference value of CUSUM statistic.

c.zero

An initial state of CUSUM statistic (default is 0).

maxndec

The maximum number of decimal places of refv ( 7L).

Details

For CUSUM control chart for detecting mean increase, the CUSUM statistic (C_{t}) are defined as following:

C_{t}=max(C_{t-1}, 0) + X_{t} - refv, t=1,2,...,

wherein X_{t} is a count process of interest.

Value

A time-series object of CUSUM statistic for monitoring of mean increase.

Examples

1
2
3
4
5
6
# Example 1: Poisson distribution
Ct <- XtToCt(Xt = rpois(200L, 4), refv = 5, c.zero = 0)
plot(Ct, type = "o", pch = 16, main = "CUSUM statistic",
     ylab = expression(C[t]),
     sub = expression(paste(C[t],"=", "max(",C[t - 1],",",0,")",
                            "+ refv -",X[t])))

attrCUSUM documentation built on May 2, 2019, 9:25 a.m.