powered by
Computes time-weighted moving statistics EWMA or tabular CUSUM
twms(x, type = c("ewma", "cusum"), lambda, mu0, K, x0 = 0)
the vector of observations to compute the time-weighted moving statistic for.
the type of statistic used in the computation.
the parameter of EWMA
the mean of the observations
the parameter of tabular CUSUM
the starting value for the time-weighted moving statistics.
the EWMA or tabular CUSUM statistics
# NOT RUN { z <- twms(1:10, "ewma", lambda=0.2) C <- twms(1:10, "cusum", mu0=5, K=1) # }
Run the code above in your browser using DataLab