validate_rt() calculates Rt and "forecast" errors from a a sample decomposition, a reference decomposition, and decomposition parameters. It is designed to be used as a mapping function passed to map() within cv_decomposition().

validate_rt(
  .data,
  .ref,
  incid,
  .t,
  serial_interval_mean,
  serial_interval_sd,
  half_trend
)

Arguments

.data

The cross-validation results from cv_linelist_decomposition()

.ref

Reference Rt

incid

The quoted name of a numeric column containing the incidence curve

.t

The quoted name of a date column corresponding to the observations in incid

serial_interval_mean

The average number of days between infection of a primary case and a secondary case

serial_interval_sd

The standard deviation of the number of days between infection of a primary case and a secondary case

half_trend

The portion of the trend conditional on future data

Value

A tibble of rt estimates and associated errors in each summary statistic