ewma_loop: Loop for EWMA

View source: R/alert_ewma.R

ewma_loopR Documentation

Loop for EWMA

Description

Loop for EWMA and adjustment of outlying smoothed values

Usage

ewma_loop(df, t, y, B, g, w1, w2)

Arguments

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

Value

A data frame with p-values and test statistics


CDCgov/Rnssp documentation built on May 12, 2024, 1:32 a.m.