Solution (source code)

= Solution

Treat the diagnosis counts as the observed <incidence> series and define their total infectiousness by
$$
s_t=\sum_{\tau=1}^{t}g_\tau I_{t-\tau}.
$$
A conditionally independent <Poisson observation model> for the renewal process is
$$
I_t\mid R_t,g,I_0,\ldots,I_{t-1}\sim\operatorname{Poisson}(R_ts_t),
\qquad
p(I_1,\ldots,I_T\mid R,g)=\prod_{t=1}^{T}
\frac{e^{-R_ts_t}(R_ts_t)^{I_t}}{I_t!}.
$$
Initial infections before the observation window can be included in the definition of $s_t$.