twms: Time-Weighted Moving Statistic

View source: R/twms.R

twmsR Documentation

Time-Weighted Moving Statistic

Description

Computes time-weighted moving statistics EWMA or tabular CUSUM

Usage

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

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

spc4sts documentation built on May 24, 2022, 5:07 p.m.