Introduction to the time-varying reproduction number
Nowcasting and forecasting of infectious disease dynamics
Convolution session
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?
Infections depend on previous infections
Remember the definition of the generation time distribution \(g(t)\):
infection (person A) to infection (person B, infected by A)
Through this, infections depend on previous infections: