Let \(\mathbf {x}_t=(R_t,\mathbf {s}_t,\mathbf {z}_t)\) .
Our aim is to perform inference on the whole set of latent variables \(\mathbf {x}_{1:t}=(\mathbf {x}_1,...,\mathbf {x}_t)\)  as well as on static hyper-parameters \(\mathbf {\theta }\)  at each time-point \(t\) , by means of the posterior distribution \(p(\mathbf {x}_{1:t},\mathbf {\theta }|\mathbf {y}_{1:t})\) .
A description of the SMC algorithm with resampling at each step is given in Algorithm . See also [1]}, which contains more general algorithms. Although in this paper we focus on inference for \(R_t\) , also \(\mathbf {s}_t\)  will be of interest.
In our setting, the main computational burden is the sampling from \(P_s(R_t,\mathbf {s}_{t-1};d\mathbf {s}_t)\)  which has been parallelised in our implementation. For resampling, residual resampling [2]} has been applied. However, the resampling step is both hard to parallelise and requires message passing, resulting in that a too high number of cores can decrease performance.
[t]
Auxiliary SMC with resampling at each time step. Operations involving index \(b\)  must be performed for \(b=1,...,B\) . Here \(P_t^x\)  denotes the transition distribution for \(\mathbf {x}_t\) , while \(Q_t\)  is the proposal distribution for \(\mathbf {x}_t\) . The indices \(A_t^{1:B}\)  defines the ancestral particles at time \(t\)  after resampling.

[1]
\(\mathbf {x}^b_0\sim Q_0(d\mathbf {x}_0)\) Proposal at time 0
\(w^b_0=\frac{P_0(d\mathbf {x}^b_0)H(\mathbf {y}_t|\mathbf {x}^b_0)}{Q_0(d\mathbf {x}^b_0)}\) ,   \(W^b_0=w^b_0/\sum _{m=1}^Bw^{m}_0\) Calculating weights
\(\ell _0^B=\frac{1}{B}\sum _{b=1}^Bw^b_0\) Estimate of \(p(\mathbf {y}_0)\) 
\(t=1\)  to \(T\) 
\(A_t^{1:B} = \text{resample}(W^{1:B}_{t-1})\) Resampling
\(\mathbf {x}^b_t\sim Q_t(\mathbf {x}^{A_t^b}_{t-1},d\mathbf {x}_t)\) Proposal at time \(t\) 
\(w^b_t=w^b_{t-1}\frac{P_t(\mathbf {x}^{A_t^b}_{t-1},d\mathbf {x}^b_t)H(\mathbf {y}_t|\mathbf {x}^b_t)}{Q_t(\mathbf {x}^{A_t^b}_{t-1},d\mathbf {x}^b_t)}\) ,    \(W^b_t=w^b_t/\sum _{m=1}^Bw^m_t\) Calculating weights
\(\ell ^B_t=\frac{1}{B}\sum _{b=1}^Bw^b_t\) Estimate of \(p(\mathbf {y}_t|\mathbf {y}_{t-1})\) 


The SMC algorithm is by design sequential so that by storing values of \(\mathbf {x}_t\)  obtained at the previous day, updates can easily be performed as new data arrive.
A main challenge here is that the state \(\mathbf {x}_t\)  at time \(t\)  heavily depends on future observations \(\mathbf {y}_{t+h}\)  because of the delay in hospitalisation. Although the reformulated model reduces immediate dependence, there are still strong correlations backwards, as illustrated in Figure REF . There are clearly possibilities to develop more efficient proposal distributions, despite the availability of the SEIR model only as a computer algorithm. Because the main purpose of this paper is to investigate the utility of SMC methods for the estimation of daily varying reproduction numbers, we use only simple bootstrapping proposals. We do however take into account the delay aspect by
using fixed lag smoothing, using data ahead of current time, that is
\(\widehat{R}_{t|t+l_t}=E[R_t|\mathbf {y}_{1:t+l_t}]\approx \frac{1}{B}\sum _{b=1}^BR_t^b\) 
