16 EpiEstim
We present Julia implementations of EpiEstim (this chapter), EpiFilter (Chapter 17), and a heavily simplified version of (Chapter 18). The (approximate) EpiNow2 implementation also requires the installation of Stan, while EpiEstim and EpiFilter are implemented natively.
Much of the code for EpiEstim and EpiFilter has been reproduced from previous work [CITE PAPER WITH KRIS].
16.1 Model definition
EpiEstim assumes that (typically daily) \(R_t\) is fixed over trailing windows of length \(k\). A common choice of this parameter value is \(k = 7\), in which case estimates produced by EpiEstim are referred to as weekly estimates. The Poisson renewal model is used, giving likelihood:
\[ L(R_t | C_{1:t}, k) = \prod_{s = t - k + 1}^t \text{Poisson PDF}\left(C_s; R_t \Lambda_s^c \right) \]
where \(\Lambda_t^c\) is the force-of-infection of reported cases. A \(\text{Gamma}(\alpha_0, \beta_0)\) prior distribution is placed on \(R_t\), such that the posterior distribution can be shown to be:
\[ P(R_t | C_{1:t}, k) \sim \text{Gamma}\left(\alpha = \alpha_0 + \sum_{s=t-k+1}^t C_s, \beta = \beta_0 + \sum_{s=t-k+1}^t \Lambda_s \right) \]