# Non-Parametric Model-Based Estimation of the Effective Reproduction Number for SARS-CoV-2 +
## 2 Materials and Methods
### Estimation of Time-Dependent Parameters in Non-Linear ODE Models via the Augmented Kalman Smoother
#### 2.2.2 Augmented Kalman Smoother  
To estimate the unobserved process states in the state-space model represented by Equation (5), particularly for non-linear models, the Extended Kalman Smoother (EKS) is employed [60]. The EKS assumes time-constant parameters and necessitates input values for all model parameters. For the estimation of the time-dependent parameters, we introduce an extension of the Extended Kalman Filter and Smoother algorithms, which we refer to as the Augmented Kalman Smoother (AKS), following the principles of the previously published Augmented Kalman Filter [61; 62]. The AKS formulation closely resembles that of the EKS, but with a key difference: it introduces additional process states for each time-dependent model parameter. Consequently, the AKS only requires appropriate initial values for those states and parameters that vary over time. As a result of this enhancement, the AKS provides estimates not only for the time courses of unobserved process states but also for the time courses of the time-dependent model parameters. Furthermore, the AKS method simultaneously estimates the covariance matrices \(P\) of the state-space vector \(x\) of the analyzed process. The algorithm is initialized at time point \(k=1\), where the process-state vector \(x_{0}\) and the process-state covariance matrix \(P_{0}\) at time point \(k=0\) are provided as inputs for the iterations. The first step of the algorithm is the so-called _prediction step_  
\[x_{k|k-1} =b(x_{k-1|k-1}) \tag{6}\] \[P_{k|k-1} =F_{k}\cdot P_{k-1|k-1}\cdot F_{k}^{\mathrm{T}}+Q. \tag{7}\]  
Here, \(x_{k|k-1}\) and \(P_{k|k-1}\) represent the predicted state vector and covariance matrix at time \(k\), respectively, based on the \(k-1\) previous data points. The initial predicted state vector \(x_{1|0}\) is computed by applying the transition function \(b\) to the state vector \(x_{0}\). During the step-wise linearization process, the Jacobian of \(b\) at the point \(x_{k-1|k-1}\) is calculated as  
\[F_{k}=\frac{\partial b}{\partial x}\bigg{|}_{x_{k-1|k-1}}. \tag{8}\]  
The second step of the algorithm is the _update step_, where the predicted state vector and covariance matrix are updated by using the noisy measurement \(y_{k}\):  
\[K_{k} =P_{k|k-1}\cdot H_{k}^{\mathrm{T}}\cdot\left(H_{k}\cdot P_{k|k-1} \cdot H_{k}^{\mathrm{T}}+M\right)^{-1} \tag{9}\] \[x_{k|k} =x_{k|k-1}+K_{k}\cdot\left(y_{k}-H_{k}\cdot x_{k|k-1}\right)\] (10) \[P_{k|k} =P_{k|k-1}-K_{k}\cdot H_{k}\cdot P_{k|k-1} \tag{11}\]  
The Kalman gain, denoted as \(K_{k}\), is obtained via Equation (9), utilizing the measurement covariance matrix \(M\) and the predicted covariance matrix \(P_{k|k-1}\) of the process. It represents the relative weight between the noisy measurements and the model predictions, where a larger Kalman gain implies that more emphasis is placed on the measurements for the next prediction step. This effectively balances the uncertainties of the model predictions and the measurement uncertainties, enabling adaptive updates. The predictions are subsequently updated according to Equations (10) and (11), completing one iteration of the algorithm. The updated state vector \(xk|k\) and the updated covariance matrix \(Pk|k\) are then used as inputs for the following prediction step. This iterative process is repeated until all the observed time points have been considered. The filter, defined by Equations (6)-(11), performs forward estimation of the state-space vector \(x\) and its covariance matrix \(P\). A limitation of this filtering method is that the estimate \(x_{k|k}\) is only based on the \(k-1\) previous data points, resulting in estimates at the beginning of the time series being less informed than those at the end. Furthermore, the estimates of the filter always lag one step behind the data. To address this issue, the filter is commonly combined with a smoother, resulting in a Rauch-Tung-Striebel Smoother [63]. The smoother runs backward from \(k=N-1\) to \(k=0\), initialized with the last updated estimates of the filter \(x_{N|N}\) and \(P_{N|N}\).