Skip to contents

A specific parameter or set of parameters can be estimated by a pipeline. This function applies the pipeline to a synthetic epidemic with sawtooth incidence resulting from a stepped growth rate function. The lag between synthetic input and estimate is assessed by minimising the root mean square error of input and estimated based on different lag offsets.

Usage

quantify_lag(pipeline, ip = i_empirical_ip, lags = -10:30)

Arguments

pipeline

a function taking an input dataset and an infectivity profile as inputs and producing an estimate as output. This is the whole parametrised pipeline including any other inputs. This can be a purrr style function.

ip

the infectivity profile.

A dataframe containing the following columns:

  • boot (anything + default(1)) - a bootstrap identifier

  • probability (proportion) - the probability of new event during this period.

  • a0 (double) - the beginning of the time period (in days)

  • a1 (double) - the end of the time period (in days)

Must be grouped by: boot (exactly).

A default value is defined.

lags

a vector with the delays to test. Defaults to -10 to +30 days

Value

a lag analysis dataframe containing the estimate type and the lag in days that the estimate is behind the actual observation

Examples

pipeline = ~ .x %>% poisson_locfit_model() %>% rt_from_incidence(ip = .y)
lag_analysis = quantify_lag(pipeline)

quantify_lag(~ rt_epiestim(.x,ip = .y))
#> # A tibble: 1 × 2
#> # Groups:   estimate [1]
#>   estimate   lag
#> * <chr>    <int>
#> 1 rt           8