# Cross-Entropy Method in Application to the SIRC Model
## 2 Optimization of Control for SIRC Model
### Optimization of the Epistemological Model by the CE Method  
[PERSON] and [PERSON] [6] present the way in which the cross-entropy method can be used to solve the optimization of the epistemological model consisting of ordinary differential equations. The main task was to minimize the objective function \(J(u)\) depending on one optimization function \(u(t)\) over a certain set \(U\) consisting of continuous functions \(u\). The minimum can be saved as:  
\[\gamma^{*}=J(u^{*})=\min_{u\in U}J(u) \tag{7}\]  
Parameterizing the minimum problem looks as follows:  
\[\min_{c\in C}J(u_{c}), \tag{8}\]  
where \(u_{c}\) is a function from \(U\), which is parameterized by a certain control vector \(c\in\mathbb{R}^{m}\). Collection \(C\) is a set of vectors \(c\). It should be noted that the selected set \(C\) should be big enough to get the enough precise solution. Then in such a set there are such \(c^{*}\)--which will be the optimal control vector and \(\gamma^{*}\)--optimal value, respectively. One way to parameterize a problem is to divide the time interval \([t_{1},t_{2}]\) at small intervals and using these intervals together with control vector points \(c\) to define a function \(u_{c}\). This function can be created by interpolating between points. Such interpolation can be done using e.g., the finite element method, finite difference method, finite volume method or cubic B-Spline. [PERSON] et al. [34] and [PERSON] et al. [35] show that all of this methods can be used to the two-point boundary value problems. Here the FEM method was used (v. [36]). The results for the other methods have not been checked. The choice of the approximation method is a difficult and interesting issue, but this is not what is consider here. With this function \(u_{c}\), it takes form  
\[u_{c}(t)=\sum_{t=0}^{n}c_{i}k_{i}(t) \tag{9}\]where  
\[k_{i}(t)= \begin{cases}\frac{t-t_{i-1}}{t_{i}-t_{i-1}}&\text{for }t\in[t_{i-1},t_{i}] \\ \frac{t_{i+1}-t}{t_{i+1}-t_{i}}&\text{for }t\in[t_{i},t_{i+1}]\\ 0&\text{otherwise}.\end{cases}  \tag{10}\]  
Now when \(u_{c}\) is represented as a parameterized function, the value can be countedJ\((u_{c})\) by solving the system of ordinary differential Equation (3) e.g., by the Runge-Kutta method. The idea of using the CE method in this problem is to use a multi-level algorithm with generated checkpoints \(c_{i}\), here, from a normal distribution. The CE method does not impose the distribution. Usually it is chosen from the family of density which is expected. Here, it is expected that there will be one high peak at the peak of the epidemic. Hence the normal distribution. Then, update the distribution parameters using the CE procedure using the target indicator as a condition for selecting the best samples. The calculations are carried out until the empirical variance of optimal control function is smaller than the given \(\epsilon\). This means that the function values are close to the optimal expected value The idea of applying the CE method to the SIRC model is similar. The only difficulty is the fact that when optimizing the SIRC model there are two functions instead of one as in the case of the algorithm described here. In the form of an Algorithm 1, it looks as follows:  
```
1. Initialize: Choose \(\mu_{0}^{(u)}=\{\mu_{i0},i=0,\ldots,n\}\), \(\sigma_{0}^{(u)}=\{\sigma_{i0},i=0,\ldots,n\}\), \(\mu_{0}^{(v)}=\{\mu_{i0},i=0,\ldots,n\}\) and \(\sigma_{0}^{(v)}=\{\sigma_{i0},i=0,\ldots,n\}\), set \(k=1\)
2. Draw: Generate a random samples \(C_{1},\ldots,C_{N}\sim N({\mu_{k-1}^{(u)},{\sigma_{k-1}^{(u)}}^{2}})\) and \(D_{1},\ldots,D_{N}\sim N({\mu_{k-1}^{(v)},{\sigma_{k-1}^{(v)}}^{2}})\) with \(C_{m}=\{C_{mi},i=0,\ldots,n\}\) and \(D_{l}=\{D_{li},i=0,\ldots,n\}\). 3. Evaluate: For each control vector \(C_{m}\) and \(D_{m}\) evaluate the objective function \(J(u_{C_{m}},u_{D_{l}})\) by solving the ODE system
4. Find the \(p\) best performing samples, based on the values \(\{J(u_{C_{m},D_{l}})\}\). Let \(I\) be the corresponding set of indices. 5.