twms: Time-Weighted Moving Statistic

Description Usage Arguments Value Author(s) Examples

View source: R/twms.R

Description

Computes time-weighted moving statistics EWMA or tabular CUSUM

Usage

1
twms(x, type = c("ewma", "cusum"), lambda, mu0, K, x0 = 0)

Arguments

x

the vector of observations to compute the time-weighted moving statistic for.

type

the type of statistic used in the computation.

lambda

the parameter of EWMA

mu0

the mean of the observations

K

the parameter of tabular CUSUM

x0

the starting value for the time-weighted moving statistics.

Value

the EWMA or tabular CUSUM statistics

Author(s)

Anh Bui

Examples

1
2
z <- twms(1:10, "ewma", lambda=0.2)
C <- twms(1:10, "cusum", mu0=5, K=1)

spc4sts documentation built on July 2, 2021, 5:06 p.m.