enw_delay_metadata: Calculate reporting delay metadata for a given maximum delay

enw_delay_metadataR Documentation

Calculate reporting delay metadata for a given maximum delay



Calculate delay metadata based on the supplied maximum delay and independent of other metadata or date indexing. These data are meant to be used in conjunction with metadata on the date of reference. Users can build additional features this data.frame or regenerate it using this function in the output of enw_preprocess_data().

enw_delay_metadata() was renamed to enw_metadata_delay() for better consistency.


enw_delay_metadata(max_delay = 20, breaks = 4)



The maximum number of days to model in the delay distribution. Must be an integer greater than or equal to 1. Observations with delays larger then the maximum delay will be dropped. If the specified maximum delay is too short, nowcasts can be biased as important parts of the true delay distribution are cut off. At the same time, computational cost scales non-linearly with this setting, so you want the maximum delay to be as long as necessary, but not much longer. Consider what delays are realistic for your application, and when in doubt, check if increasing the maximum delay noticeably changes the delay distribution or nowcasts as estimated by epinowcast. If it does, your maximum delay may still be too short. Note that delays are zero indexed and so include the reference date and max_delay - 1 other days (i.e. a max_delay of 1 corresponds to no delay). You can use check_max_delay() to check the coverage of a delay distribution for different maximum delays.


Numeric, defaults to 4. The number of breaks to use when constructing a categorised version of numeric delays.


A data.frame of delay metadata. This includes:

  • delay: The numeric delay from reference date to report.

  • delay_cat: The categorised delay. This may be useful for model building.

  • delay_week: The numeric week since the delay was reported. This again may be useful for model building.

  • delay_tail: A logical variable defining if the delay is in the upper 75% of the potential delays. This may be particularly useful when building models that assume a parametric distribution in order to increase the weight of the tail of the reporting distribution in a pragmatic way.


enw_delay_metadata(max_delay = 20, breaks = 4)

seabbs/epinowcast documentation built on July 8, 2024, 1:45 a.m.