ewma_loop | R Documentation |
Loop for EWMA and adjustment of outlying smoothed values
ewma_loop(df, t, y, B, g, w1, w2)
df |
A data frame, data frame extension (e.g., a tibble), or a lazy data frame |
t |
Name of the column of type Date containing the dates |
y |
Numeric vector of counts or percentages |
B |
Baseline parameter. The baseline length is the number of days used to calculate rolling averages, standard deviations, and exponentially weighted moving averages. Defaults to 28 days to match ESSENCE implementation. |
g |
Guardband parameter. The guardband length is the number of days separating the baseline from the current test date. Defaults to 2 days to match ESSENCE implementation. |
w1 |
Smoothing coefficient for sensitivity to gradual events. Must be between 0 and 1 and is recommended to be between 0.3 and 0.5 to account for gradual effects. Defaults to 0.4 to match ESSENCE implementation. |
w2 |
Smoothed coefficient for sensitivity to sudden events. Must be between 0 and 1 and is recommended to be above 0.7 to account for sudden events. Defaults to 0.9 to match ESSENCE implementation and approximate the C2 algorithm. |
mu |
Numeric vector of baseline averages |
A data frame with p-values and test statistics
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.