Introduction to the time-varying reproduction number
Nowcasting and forecasting of infectious disease dynamics
Independent infections model
functions {#include "functions/convolve_with_delay.stan"}data {int n; // number of time daysarray[n] int obs; // observed onsetsint<lower = 1> ip_max; // max incubation period// probability mass function of incubation period distribution (first index zero)array[ip_max + 1] real ip_pmf;}parameters {array[n] real<lower = 0> infections;}transformed parameters {array[n] real onsets = convolve_with_delay(infections, ip_pmf);}model {// priors infections ~ normal(0, 10) T[0, ]; obs ~ poisson(onsets);}
Prior for infections at time \(t\) is independent from infections at all other time points. Is this reasonable?
What if we convolve infections with infections?
We can use the concept of a convolution to link infections over time:
This captures the fundamental transmission process in epidemics
Generation time: infection to infection
Here rather than the time from infection (person A) to symptoms (person B, infected by A) we have the time from infection (person A) to infection (person B, infected by A).
This is known as the generation time distribution (\(g(t)\)).