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?
What if we convolve infections with infections?
We can extend the convolution concept from the last session:
This session: infections → infections (via generation time)
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)\)).