# Reconstruction of Epidemiological Data in Hungary Using Stochastic Model Predictive Control
## 4 Statistical Analysis for Normally Distributed Model Parameters
### Linear Approximation of the State Dynamics around the Expectation  
In the literature, there exist different stochastic sample-based optimization approaches for a predictive optimal controller design; see, e.g., [45; 46; 47; 48; 49; 50]. However, these approaches are computationally tractable only for a shorter prediction horizon. Alternatively, we have the possibility to formulate deterministic recursions for the first two moments of the state vector, e.g., [51] proposed the state transition function \(f\) to be approximated by its first-order Taylor polynomial around the expected values \(\mu_{k}=(\mu_{k}^{x},\mu_{k}^{u},\mu^{\theta})\) of the probabilistic variables (\(\hat{x}_{k}\), \(\hat{u}_{k}\), \(\hat{\theta}_{k}\)), namely:  
\[\hat{x}_{k+1}\approx\tfrac{\partial f}{\partial(x,u,\theta)}(\mu_{k},v_{k}) \begin{pmatrix}\hat{x}_{k}\\ \hat{\theta}_{k}\end{pmatrix} + f(\mu_{k},v_{k})-\tfrac{\partial f}{\partial(x,u,\theta)}(\mu_{k},v_{k})\,\mu_{k}. \tag{17}\]  
This approach leads to a deterministic mean-variance (\"\(\mu\Sigma\)\") dynamics, which is typically nonlinear in the free variables \(\mu_{k}^{x}\) and \(\mu_{k}^{u}\).  
\[\mu_{k+1}^{x}=f(\mu_{k},v_{k}), \tag{18a}\] \[\Sigma_{k+1}^{x\theta}=\tfrac{\partial f}{\partial(x,u,\theta)}(\mu_{k},v_{k}) \begin{pmatrix}I-K^{\top}(\mu_{k}^{x})\,0\\ 0\end{pmatrix}^{\top}\begin{pmatrix}\Sigma_{k}^{x\theta}\\ \Sigma^{\theta}\end{pmatrix},\] (18b) \[\Sigma_{k+1}^{x}=\tfrac{\partial f}{\partial(x,u,\theta)}(\mu_{k},v_{k}) \,\Sigma_{k}\,\left(\tfrac{\partial f}{\partial(x,u,\theta)}(\mu_{k},v_{k}) \right)^{\top}. \tag{18c}\]  
Note that the linear [PERSON] approximation of \(\hat{x}_{k+1}\) allowed us to express the non-quadratic term in the cost function (14) as follows:  
\[\operatorname{Cov}(\hat{x}_{k+1},\hat{x}_{k})=\tfrac{\partial f}{\partial(x,u,\theta)}(\mu_{k},v_{k})\begin{pmatrix}I-K^{\top}(\mu_{k}^{x})\,0\\ 0\end{pmatrix}^{\top}\begin{pmatrix}\Sigma_{k}^{x}\\ \Sigma_{k}^{x\theta}\end{pmatrix} \tag{19}\]The dynamic equations in (18) constitute a possible deterministic _prediction model_ for System (10) and result in the following nonlinear optimal predictive control problem.  
**Problem 2** (\(\mu\Sigma\)-NMPC for unknown-input state reconstruction).: _Given the dynamical model (18) with an initial state distribution (9), an i.i.d. parameter process (8), a measured disturbance \(v_{k}\), an input policy (12) with a fixed gain function \(K\), and a reference output trajectory \(r_{k+1}\) to track (\(k\in\mathbb{T}_{0}^{T-1}\)), we looked for a sequence of deterministic values \(\mu_{k}^{u}\), state moments \(\mu_{k+1}^{x}\), \(\Sigma_{k+1}^{x}\), and covariance matrices \(\Sigma_{k+1}^{x\theta}\) with \(\Sigma_{0}^{x\theta}=0\), which solve (18), satisfy the input constraint (16), and minimize the cost (14). The free variables of the optimization are collected in (15)._  
Problem 2 is a _stochastic data assimilation_ problem, reformulated as an optimal predictive tracking problem with a deterministic nonlinear \(\mu\Sigma\)-prediction model (10). Henceforth, we refer to Problem 2 as a _Gaussian_ or _mean-variance_ NMPC problem (\(\mu\Sigma\)-NMPC). In general, the variance dynamics (18b,c) significantly increase the complexity of the control problem. If \(n\) and \(p\) denote the dimension of the state \(\hat{x}_{k}\) and the parameter \(\hat{\theta}_{k}\), respectively, the equations in (18) comprise \(np+n(n+1)/2\) separate scalar equations, whereas the deterministic model (6) constitutes a system of \(n\) scalar equations. Therefore, the \(\mu\Sigma\)-NMPC in Problem 2 is typically (at least) an order of magnitude more demanding than the ordinary NMPC in Problem 1. However, an appropriate initial guess for the solution of \(\mu\Sigma\)-NMPC may reduce the computational complexity of the optimization substantially by providing a fast convergence of the solution.