## Introduction

The coronavirus disease 2019 (COVID-19), a disease outbreak of atypical pneumonia that originated from Wuhan, China1, has caused globally at least 250 million confirmed cases, including an estimated 5 million deaths in approximately 221 countries and territories by November 2021. The World Health Organization (WHO) declared the COVID-19 crisis a pandemic on 11 March 2020.

In modelling the disease’s transmission as well as to inform and evaluate control policies, it is particularly important to estimate its reproduction number. Early estimates for COVID-19 basic reproduction number $${\mathscr {R}}_0$$, that denotes the transmission potential of infectious disease when introduced to a completely susceptible population, ranged from 1.4 to 6.492. The effective (or instantaneous) reproduction number $${\mathscr {R}}_t$$, on the other hand, reflects the extent of transmission in the presence of population immunity or intervention. Thus, the estimation of $${\mathscr {R}}_t$$ is important for evaluating public measure success. However, estimation of $${\mathscr {R}}_t$$ is sensitive to the model structure and parameter assumptions3. As a case in point, due to incorporation of more individual case information and travel data, the estimate for $${\mathscr {R}}_0$$ in Wuhan was revised upward from 2.2–2.7 to 5.74. On the other hand, data inavailability or poor quality often hinders the use of certain estimation methods, such as serial interval data that are usually needed to estimate $${\mathscr {R}}_t$$ (e.g., Fraser5, Wallinga and Teunis6, Cauchemez et al.7, White and Pagano8).

In the course of calculating the exact value of $${\mathscr {R}}_t$$, especially when the data has not yet reached its peak, precise assumptions and data estimates are needed. Nishiura et al.9 discussed a likelihood-based approach to estimate $${\mathscr {R}}_t$$ from early epidemic growth data, while Cazelles at al.10 used stochastic models for the disease dynamics coupled with particle Markov chain Monte Carlo algorithm. Using the compartmental Susceptible-Infectious-Recovered (SIR) model, Bettencourt and Ribeiro11 use the incidence data to estimate $${\mathscr {R}}_0$$ and $${\mathscr {R}}_t$$. In this paper, based on the Susceptible-Infectious-Recovered-Dead (SIRD) model as a reference, we develop a novel approach to estimate $${\mathscr {R}}_t$$ of COVID-19. It uses information on the number of infected or active (I), recovered (R), and death (D) cases, which are readily available for all affected countries, so that they can be accessed rather easily. This method does not require information regarding serial intervals, which makes the estimation procedure simpler without reducing the quality of the estimate. We assume mass population testing is sufficiently enough, such that the positive rate is below 5% recommended by WHO. This is to ensure data quality of the number of infection is acceptable since asymptomatic carrier transmission is often underestimated12.

The reproduction number is estimated from reported cases under uncertainties using a two-stage estimation method based on the Extended Kalman Filter (EKF) and a low-pass filter. The method not only considers the nominal number of reported cases, but also its daily pattern. To show our method’s practical ability, we apply it to COVID-19 cases in the Scandinavian countries: Denmark, Sweden, and Norway, and compare the results with two commonly used Bayesian methods due to Bettencourt and Ribeiro11 and Cori et al.5,13. We show that the results are indeed comparable. Remark that a similar approach, developed independently, can be found in14. The difference is in computational technique to estimate the reproduction number. In this paper, we estimate the reproduction number using EKF, while in14 it was estimated using Kalman smoother.

## A discrete-time stochastic augmented compartmental model

Our estimation method is based on the compartmental SIRD model that can be written as the following first-order nonlinear differential equations:

\begin{aligned} {\dot{S}}(t)= & {} -\frac{\beta I(t)S(t)}{N}, \end{aligned}
(1)
\begin{aligned} {\dot{I}}(t)= & {} \frac{\beta I(t)S(t)}{N}-(\gamma +\kappa ) I(t),\end{aligned}
(2)
\begin{aligned} {\dot{R}}(t)= & {} \gamma I(t),\end{aligned}
(3)
\begin{aligned} {\dot{D}}(t)= & {} \kappa I(t), \end{aligned}
(4)

where S, I, R, and D denote the number of susceptible cases, the number of active cases, the number of recovered cases, and the number of deceased cases, respectively. N is the total number of population, $$\beta$$ is the average number of contacts per person per time, while $$\gamma$$ and $$\kappa$$ are the recovery and death rate. Remark that the value of $$\beta$$ is time-varying due to intervention, i.e., $$\beta$$ = $$\beta (t)$$. To use the model, we require information on the average infectious time $$T_i$$ and the Case Fatality Rate (CFR), so that

\begin{aligned} \gamma = \frac{1-\text {CFR}}{T_i},\, \kappa = \frac{\text {CFR}}{T_i}. \end{aligned}
(5)

For COVID-19, we take $$T_i=9$$ as the infectious period on average lasts for 9 days (7–11 days with 95% CI)15, while the CFR is assumed around 1%. The time-varying effective reproduction number is then given by:

\begin{aligned} {\mathscr {R}}_t(t) = \frac{S(t)}{N} \left( \frac{\beta (t)}{\gamma +\kappa }\right) \approx \frac{\beta (t)}{\gamma +\kappa }. \end{aligned}
(6)

The approximation is under the assumption that government intervention is taken at an early stage so that the susceptible is relatively the same over time as the total population. This is the case especially for emerging diseases. We modify the SIRD model by augmenting the following two equations into the system:

\begin{aligned} {\dot{E}}(t)= & {} (\gamma +\kappa )I(t)-E(t),\quad {\dot{{\mathscr {R}}_t}}(t)=0. \end{aligned}
(7)

The former equation takes into account the daily number of new reported cases E, while the latter one says that the effective reproduction number $${\mathscr {R}}_t$$ is assumed to be a piece-wise constant function with jump every 1 day time interval.

Discretizing the model using the forward Euler method, we obtain the following discrete-time augmented SIRD model:

\begin{aligned} S(k+1)= \,& {} \left( 1-\frac{(\gamma +\kappa )\Delta t}{N}{\mathscr {R}}_t(k)I(k)\right) S(k),\end{aligned}
(8)
\begin{aligned} I(k+1)=\, & {} (1-(\gamma +\kappa )\Delta t)I(k)+\frac{(\gamma +\kappa )\Delta t}{N}{\mathscr {R}}_t(k)I(k)S(k),\end{aligned}
(9)
\begin{aligned} R(k+1)=\, & {} R(k)+\gamma \Delta t I(k),\end{aligned}
(10)
\begin{aligned} D(k+1)=\, & {} D(k)+\kappa \Delta t I(k),\end{aligned}
(11)
\begin{aligned} E(k+1)= \,& {} (\gamma +\kappa )\Delta t I(k)+(1-\Delta t)E(k),\end{aligned}
(12)
\begin{aligned} {\mathscr {R}}_t(k+1)=\, & {} {\mathscr {R}}_t(k). \end{aligned}
(13)

Our method computes a new estimate of $${\mathscr {R}}_t$$ based on new reported cases. Since their frequency is low (could be once a day), the reported data can be interpolated using, e.g., a modified Akima cubic Hermite interpolation, such that it fits with the time step $$\Delta t$$. In our simulation, the time step $$\Delta t$$ is chosen as 0.01, i.e., 100 time discretization within 1 day interval. The confidence interval of our estimated $${\mathscr {R}}_t$$ is determined by computing the reproduction number for different values of the infectious period $$T_i$$ within a certain interval.

To simplify the presentation, we define the augmented state vector

\begin{aligned} \varvec{x}(k+1)= & {} \begin{pmatrix}S(k+1)\\ I(k+1)\\ R(k+1)\\ D(k+1)\\ E(k+1)\\ {\mathscr {R}}_t(k+1)\end{pmatrix}, \end{aligned}
(14)

and as such, the discrete-time augmented SIRD model (8)–(13) can be written as follows

\begin{aligned} \varvec{x}(k+1)= & {} \varvec{f}(\varvec{x}(k))+\varvec{w}(k), \end{aligned}
(15)

where $$\varvec{f}$$ is the nonlinear term written in the right hand side of (8)–(13) and $$\varvec{w}$$ is introduced as an uncertainty to model the inaccuracies due to simplification in the modelling. The uncertainty is assumed to be a zero mean Gaussian white noise with known covariance $$\varvec{Q}_F$$. This is to simplify the calculation since the actual epidemic data usually follow Gamma distribution. In practice, $$\varvec{Q}_F$$ can be considered as a tuning parameter for the EKF. Thus, the transmission model becomes a discrete-time stochastic augmented SIRD model.

Reported cases, such as the number of active cases and the cumulative numbers of recovered and death, can be incorporated into the model using the following output vector

\begin{aligned} \varvec{y}(k+1)= & {} \varvec{C}\varvec{x}(k)+\varvec{v}(k). \end{aligned}
(16)

Here, $$\varvec{v}$$ denotes uncertainties due to false testing results. We also assume the uncertainty to be a zero mean Gaussian white noise with known covariance $$\varvec{R}_F$$. As well as $$\varvec{Q}_F$$, $$\varvec{R}_F$$ can also be considered as a tuning parameter. Following the available data that include I, R, D, and E, the data/measurement matrix $$\varvec{C}$$ is taken to be

\begin{aligned} \varvec{C} = \begin{pmatrix} 1 &{} 0 &{} 0 &{} 0 &{} 0 &{} 0\\ 0 &{} 1 &{} 0 &{} 0 &{} 0 &{}0\\ 0 &{} 0 &{} 1 &{} 0 &{} 0 &{} 0\\ 0 &{} 0 &{} 0 &{} 1 &{} 0 &{} 0\\ 0 &{} 0 &{} 0 &{} 0 &{} 1 &{} 0\end{pmatrix}. \end{aligned}
(17)

## A two-stage filtering method

A two-stage filtering method is used to estimate the daily reproduction number $${\mathscr {R}}_t$$. The method consists of the EKF and a low-pass filter. In the first stage of estimation, the EKF is used to estimate the state variables and the value of $${\mathscr {R}}_t$$ under uncertainties in the number of reported cases. Afterwards, the low pass filter is used to remove short term fluctuations of the reported cases that can be caused by delays in the reporting. For example, suddenly in Denmark there were 893 recovered patients reported on 1 April 2020, in contrast to the previous days from 16 February 2020 onwards when there was no recovery reported at all. Such an accumulated delay can cause a falsely decreasing value of $${\mathscr {R}}_t$$.

The EKF is an extension of Kalman filter for nonlinear systems. The Kalman filter itself is based on a recursive Bayesian estimation and is an optimal linear filter. The idea of EKF is to linearize the non-linearity around its estimate. Due to that linearization, the optimality and stability of the EKF cannot be guaranteed. However, if the non-linearity is not severe, the EKF can give a reasonably good estimate.

Let us denote $${\hat{\varvec{x}}}(k)$$ as an estimated vector state from the EKF. Applying first-order Taylor series expansion to $$\varvec{f}$$ at $${\hat{\varvec{x}}}(k)$$, we obtain

\begin{aligned} \varvec{f}(\varvec{x}(k)) = \varvec{f}({\hat{\varvec{x}}}(k)) + \varvec{J}_{\varvec{f}}({\hat{\varvec{x}}}(k))(\varvec{x}(k)-{\hat{\varvec{x}}}(k)), \end{aligned}
(18)

where $$\varvec{J}_{\varvec{f}}({\hat{\varvec{x}}}(k))$$ is the Jacobian matrix of $$\varvec{f}$$, given by:

\begin{aligned} \varvec{J}_{\varvec{f}}({\hat{\varvec{x}}}(k)) = \begin{pmatrix} J_{11}({\hat{\varvec{x}}}(k)) &{} J_{12}({\hat{\varvec{x}}}(k)) &{} 0 &{} 0 &{} 0 &{} J_{16}({\hat{\varvec{x}}}(k))\\ J_{21}({\hat{\varvec{x}}}(k)) &{} J_{22}({\hat{\varvec{x}}}(k)) &{} 0 &{} 0 &{} 0 &{} J_{26}({\hat{\varvec{x}}}(k))\\ 0 &{} \gamma \Delta t &{} 1 &{} 0 &{} 0 &{} 0\\ 0 &{} \kappa \Delta t &{} 0 &{} 1 &{} 0 &{} 0\\ 0 &{} (\gamma +\kappa )\Delta t &{} 0 &{} 0 &{} 1-\Delta t &{} 0\\ 0 &{} 0 &{} 0 &{} 0 &{} 0 &{} 1 \end{pmatrix}, \end{aligned}
(19)

where

\begin{aligned} J_{11}({\hat{\varvec{x}}}(k))= \,& {} 1-\frac{(\gamma +\kappa )\Delta t}{N}{\hat{{\mathscr {R}}_t}}(k){\hat{I}}(k),\end{aligned}
(20)
\begin{aligned} J_{12}({\hat{\varvec{x}}}(k))= \,& {} -\frac{(\gamma +\kappa )\Delta t}{N}{\hat{{\mathscr {R}}_t}}(k){\hat{S}}(k),\end{aligned}
(21)
\begin{aligned} J_{16}({\hat{\varvec{x}}}(k))= \,& {} -\frac{(\gamma +\kappa )\Delta t}{N}{\hat{I}}(k){\hat{S}}(k),\end{aligned}
(22)
\begin{aligned} J_{21}({\hat{\varvec{x}}}(k))= \,& {} \frac{(\gamma +\kappa )\Delta t}{N}{\hat{{\mathscr {R}}_t}}(k){\hat{I}}(k),\end{aligned}
(23)
\begin{aligned} J_{22}({\hat{\varvec{x}}}(k))= \,& {} 1-(\gamma +\kappa )\Delta t+\frac{(\gamma +\kappa )\Delta t}{N}{\hat{{\mathscr {R}}_t}}(k){\hat{S}}(k),\end{aligned}
(24)
\begin{aligned} J_{26}({\hat{\varvec{x}}}(k))=\, & {} \frac{(\gamma +\kappa )\Delta t}{N}{\hat{I}}(k){\hat{S}}(k). \end{aligned}
(25)

The EKF consists of two steps: predict and update. The discrete-time stochastic augmented SIRD model is used to predict the next state and covariance and update them after obtaining new data/measurement. The EKF can be considered as one of the simplest dynamic Bayesian networks. While the EKF calculates estimates of the true values of states recursively over time using incoming measurements and a mathematical process model, recursive Bayesian estimation calculates estimates of an unknown probability density function recursively over time using incoming measurements and a mathematical process model16. Let $${\hat{\varvec{x}}}(n|m)$$ denotes the estimate of $$\varvec{x}$$ at time n given observations up to and including at time $$m\le n$$. The Kalman filter algorithm is given as follows17

### Predict

\begin{aligned} {\hat{\varvec{x}}}(k+1|k)= \,& {} \varvec{f}({\hat{\varvec{x}}}(k|k)) \end{aligned}
(26)
\begin{aligned} \varvec{P}(k+1|k)= \,& {} \varvec{J}_{\varvec{f}}({\hat{\varvec{x}}}(k|k)) \varvec{P}(k|k) \varvec{J}_{\varvec{f}}({\hat{\varvec{x}}}(k|k))^\intercal + \varvec{Q}_F(k) \end{aligned}
(27)

### Update

\begin{aligned} \varvec{{\tilde{y}}}(k+1)=\, & {} \varvec{y}(k+1)-\varvec{C}{\hat{\varvec{x}}}(k+1|k)\end{aligned}
(28)
\begin{aligned} \varvec{K}(k+1)=\, & {} \varvec{P}(k+1|k)\varvec{C}^\intercal \left( \varvec{C}\varvec{P}(k+1|k)\varvec{C}^\intercal +\varvec{R}_F(k)\right) ^{-1}\end{aligned}
(29)
\begin{aligned} {\hat{\varvec{x}}}(k+1|k+1)=\, & {} {\hat{\varvec{x}}}(k+1|k) + \varvec{K}(k+1) \varvec{{\tilde{y}}}(k+1)\end{aligned}
(30)
\begin{aligned} \varvec{P}(k+1|k+1)= \,& {} \left( \varvec{I}-\varvec{K}(k+1)\varvec{C}\right) \varvec{P}(k+1|k) \end{aligned}
(31)

Here $$\varvec{P}(k|k)$$ denotes a posteriori estimate covariance matrix. In the second stage, a low pass filter based on a rational transfer function is used to remove short term fluctuation at time step k, and is given by

\begin{aligned} {\hat{\varvec{y}}}(k) = \frac{1}{y_n}\left( {\hat{\varvec{x}}}(k)+{\hat{\varvec{x}}}(k-1)+\cdots +{\hat{\varvec{x}}}(k-y_n+1)\right) , \end{aligned}
(32)

where $$y_n$$ is a window length along the data. In our case, we choose $$y_n=\frac{3}{\Delta t}$$.

To evaluate the quality of the estimate, we calculate a Relative Root Mean Square Error (RRMSE) between the estimated and reported cases. The RRMSE is defined as

\begin{aligned} \text {RRMSE} = \frac{1}{N_d}\sum _{i=1}^{N_d} \frac{\Vert X_i-{\hat{X}}_i\Vert ^2}{\Vert X_i\Vert ^2}, \end{aligned}
(33)

where $$N_d$$ is the number of observed days and $$X\in \{I,D,R,E\}$$.

## Case study: Scandinavian countries

In this section, we apply our method to study viral transmission of COVID-19 in Denmark, Sweden, and Norway. All datasets and $$\mathsf {MATLAB}$$ code are available on GitHub (https://github.com/agusisma/covid19). As of January 2021, the three Scandinavian countries have higher cumulative testing rate compared to other parts of the world, with Denmark held a record with 260 tests per 1000 population. During that time the daily test-positivity rate is below 1% for Denmark and Norway, while Sweden is at 2.9%18. These numbers are good indications about the testing capacity in the Scandinavian countries and may describe the dynamics of the transmission better with respect to asymptomatic cases. The countries also have a different approach in their public measures in responding to COVID-19, e.g., Sweden did not implement a strict lockdown, unlike its Nordic neighbouring countries.

We plot the observed incidence of COVID-19 in Denmark, Sweden, and Norway in Fig. 1. We also plot in the same figure estimated numbers computed using our method, where good agreement is obtained. For all estimation, the process and observation covariance matrices are considered as tuning parameters and are chosen as $$\varvec{Q}_F=\text {diag}{(10\;10\;10\;10\;5\;0.2)}$$ and $$\varvec{R}_F=\text {diag}{(100\;10\;10\;5\;1)}$$, respectively. These parameters are obtained from trial and error and are chosen such that the RRMSE between the estimated and reported data are sufficiently small. In our case study, the RRMSE are shown in Table 1. Here, we can observe the method provides relatively small estimation errors for all countries. Norway has the largest error, which can be attributed to the lack of daily update of the active and recovered cases. In our simulation, we use the same tuning parameters. The error can be reduced by using different value of $$\varvec{Q}_F$$ and $$\varvec{R}_F$$.

In applying our method, we also compare it with two commonly used methods to estimate transmission parameters, namely the sequential Bayesian method of Bettencourt and Ribeiro11 that provides an approximation of the basic reproduction number, and the instantaneous method by Fraser5 that is implemented with a Bayesian analysis13,19. The former method exploits the new reported incidence, while the latter one uses the distribution of the serial interval.

First, we compare our method with Bettencourt and Ribeiro11, that allows sequential estimation of the basic reproduction number at the initial stage when the growth is still exponential. While the two methods are based on the SIR model, Bettencourt and Ribeiro11 use new incidence data and the result is filtered using a 5-day moving average filter. In Fig. 2, we plot the comparison and summarise the basic reproduction numbers that are taken to be the maximum of the curves in Table 2. It is interesting to note how the methods give rather similar estimations. This indicates that our method gives comparable results to those of11.

Finally, we plot the time-varying effective reproduction number in Fig. 3. Here, we compare our results with those using Cori et al.13. The method of13 utilises the disease serial interval, which we approximate using a shifted Gamma distribution13 with mean 4.7 and standard deviation 2.920. The prior belief for the value of $${\mathscr {R}}_t$$ is taken to be Gamma function with mean and standard deviation 5. We do not average out the data of daily new cases, but instead take the likelihood estimation of a new case at 1 day to depend also on the estimation of the previous 3 days.

In Fig. 3, we obtain that the two methods give the plot of $${\mathscr {R}}_t$$ with the same trend, indicating that our method is also comparable with13. There is a delay of about 4 days in the trend, especially with the time when the reproduction number curve crossed the horizontal axis. The delay is caused by the peaks of new daily cases and active ones that also differ by about the same days.

A different trend especially at later times between the methods appears in Fig. 3c for Norway. The curve from our method is quite smooth, while it is rather fluctuating in that using Cori et al.13. The discrepancy is caused by the active and recovered cases that apparently were not updated regularly, in contrast to the new positive cases needed by the method of13. The unreported recovery cases were all released at once on May 22, 2020, see Fig. 1c.

## Conclusion and future work

Many mathematical models and estimation methods have been developed to estimate several types of reproduction numbers during epidemic outbreaks. Here, we provide a novel method exploiting reported active, recovered and death cases using the SIR model as an underlying approach. This new method offers several advantages compared to existing methods: (1) from modeling point of view, the resulting $${\mathscr {R}}_t$$ value can follow the dynamics of the model suggested, so it is possible to develop it further if the model chosen has a higher complexity, (2) the estimation method can still be expanded in terms of statistical view, and (3) the method does not need information about serial intervals. In the case that the data provided in time series do not change much or instead have drastic changes, such as accumulating at a certain time, the resulting $${\mathscr {R}}_t$$ value will show the same spikes and serrations. As a result, the latest information from data dynamics can be more elaborated.

By applying the method to COVID-19 cases in the Scandinavian countries and comparing the results to commonly used methods due to11,13, we showed that our model is comparable, which expectedly will allow for fast assessment of the reproduction number in new outbreaks. Using the method to forecast and critically assess incidence data in countries with high under-reporting, such as Indonesia, is addressed for future work.