Skip to contents

Takes output of enw_preprocess_data() and returns a new preprocessed dataset with max_delay = 1, suitable for retrospective Rt estimation without delay modelling. Observations are taken at the specified delay (or the latest available) and treated as final counts. In the returned data, report_date is set equal to reference_date for all rows (i.e. all observations appear to be reported on the same day they occurred).

Usage

enw_retrospective(data, max_delay = NULL)

Arguments

data

Output of enw_preprocess_data().

max_delay

Integer delay at which to freeze observations. If NULL (default), the latest available observation for each reference date is used.

Value

A preprocessed data object (as from enw_preprocess_data()) with max_delay = 1.

Examples

pobs <- enw_example("preprocessed")
enw_retrospective(pobs)
#> ── Preprocessed nowcast data ─────────────────────────────────────────────────── 
#> Groups: 1 | Timestep: day | Max delay: 1 
#> Observations: 40 timepoints x 40 snapshots 
#> Max date: 2021-08-22 
#> 
#> Datasets (access with `enw_get_data(x, "<name>")`): 
#>   obs                :      40 x 7 
#>   new_confirm        :      40 x 9 
#>   latest             :      40 x 8 
#>   missing_reference  :       0 x 4 
#>   reporting_triangle :      40 x 3 
#>   metareference      :      40 x 7 
#>   metareport         :      40 x 10 
#>   metadelay          :       1 x 5