[Stable] Cleans a data frame of reported cases by replacing missing dates with 0 cases and applies an optional threshold at which point 0 cases are replaced with a moving average of observed cases. See zero_threshold for details.

create_clean_reported_cases(reported_cases, horizon, zero_threshold = 50)

Arguments

reported_cases

A data frame of confirmed cases (confirm) by date (date). confirm must be integer and date must be in date format.

horizon

Numeric, defaults to 7. Number of days into the future to forecast.

zero_threshold

[Experimental] Numeric defaults to 50. Indicates if detected zero cases are meaningful by using a threshold of 50 cases on average over the last 7 days. If the average is above this threshold then the zero is replaced with the backwards looking rolling average. If set to infinity then no changes are made.

Value

A cleaned data frame of reported cases