twms | R Documentation |
Computes time-weighted moving statistics EWMA or tabular CUSUM
twms(x, type = c("ewma", "cusum"), lambda, mu0, K, x0 = 0)
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. |
the EWMA or tabular CUSUM statistics
Anh Bui
z <- twms(1:10, "ewma", lambda=0.2) C <- twms(1:10, "cusum", mu0=5, K=1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.