Model definition: estimate_secondary()
Source:vignettes/estimate_secondary.Rmd
estimate_secondary.Rmd
This is a work in progress. Please consider submitting a PR to improve it.
This model is based on a discrete convolution of primary cases, scaled based on the fraction (here described as the secondary fraction but depending on application potentially being the case fatality ratio, case hospitalisation ratio, or the hospitalisation fatality ratio), and a delay distribution that is assumed to follow a discretised daily log normal distribution. This model can be thought of as a discrete time ordinary differential equation approximation generalised to log normal, rather than exponential, delay distributions.
We generalise this simple model beyond the incidence cases to also include prevalence indicators (for example hospital admissions and occupancy) where the secondary notifications can be thought of as depending on secondary notifications from the previous timestep, scaled current primary notifications, and minus scaled historic primary notifications weighted by some delay distribution.
This model can be defined as follows,
where and are observed primary and secondary notifications, are expected secondary notifications, and when is a prevalence measure, and when it is an incidence based measure. and are defined as the secondary fraction and delay from primary to secondary notification (or delay from secondary notification to recovery etc in the prevalence case) with typically being of most interest to those interpreting the models posterior estimates. We further assume that follows a discretised log normal distribution described by its mean and standard deviation on the log scale (where we take the cumulative mass function for time minus the cumulative mass function for ) normalised by the maximum allowed delay such that .
The above definition captures our mechanistic assumptions for the expectation of secondary notifications but does not account for potential observation noise or reporting patterns. Here we assume a negative binomial observation model (though our implementation also supports a Poisson observation model) in order to capture potential reporting overdispersion and adjust expected counts using an optional day of the week effect based on a simplex (such that so the total effect over a week is balanced). This gives the following observation process,