# Identification of Wiener Box-Jenkins Model for Anesthesia Using Particle Swarm Optimization
## 4 Simulation Results
### Identification Results  
In this section, the results of the offline identification of Wiener Box-Jenkins structure for MPP anesthesia model are presented, analyzed, and validated. The model is used to fit the input-output data collected in Section 4.1. The linear parts of the model were approximated by two transfer functions: a second-order process transfer function \(G(z^{-1})\) and a first-order noise model \(H(z^{-1})\). In addition, the Hill nonlinearity is captured using a third-order polynomial nonlinearity, where the order is selected manually. The estimates of Wiener Box-Jenkins model parameters averaged over one hundred runs are listed in Table 3. \begin{table}
\begin{tabular}{l l l} \hline  & **Parameter** & **Value** \\ \hline \multirow{3}{*}{PID controller} & \(K_{P}\) & 64.9721 \\  & \(K_{I}\) & 17.5456 \\  & \(K_{D}\) & 6.3897 \\ \hline \multirow{6}{*}{Patient} & \(\mathcal{C}_{50}^{\gamma}\) & 3.2425 \\  & \(\lambda\) & 0.3 \\  & \(\alpha\) & 0.0366 \\ \cline{1-1}  & \(\gamma\) & 1.9262 \\ \cline{1-1}  & \(k_{1}\) & 1 \\ \cline{1-1}  & \(k_{2}\) & 2 \\ \cline{1-1}  & \(k_{3}\) & 10 \\ \hline \end{tabular}
\end{table} 
Table 2: Simulation settings for PID controller gains and parameters of patient number 17. Figure 4: The atracurium infusion rate, \(u(t)\), the level of neuromuscular blockade (NMB), and the set point, \(r(t)\), in a sample run. Figure 3: SIMULINK model for the closed-loop administration of atracurium. There are several indices used to evaluate model prediction. One example is the percentage variance accounted for (%_VAF_), calculated as  
\[\%\textit{VAF}=\left(1-\frac{\mathbb{E}[(y(t)-\hat{y}(t))^{2}]}{\mathbb{E}[(y(t) -\hat{y}(t))^{2}]}\right)\times 100\% \tag{21}\]  
where \(y(t)\) is the measured output and \(\hat{y}(t)\) is the model output. Another index is the mean absolute error (\(MAE\)) given by  
\[MAE=\frac{1}{N}\sum_{t=1}^{N}|y(t)-\hat{y}(t)| \tag{22}\]  
where \(N\) is the total number of data samples. Closely related to MAE is the mean absolute percentage error (\(MAPE\)) computed by the following formula:  
\[MAPE=\frac{1}{N}\sum_{t=1}^{N}\frac{|y(t)-\hat{y}(t)|}{\hat{y}(t)} \tag{23}\]  
Lastly, the coefficient of determination (\(R^{2}\)) is defined as:  
\[R^{2}=1-\frac{\frac{1}{N}\sum_{t=1}^{N}(|y(t)-\hat{y}(t)|)^{2}}{\frac{1}{N} \sum_{t=1}^{N}(|y(t)-\hat{y}(t)|)^{2}} \tag{24}\]  
where  
\[\hat{y}(t)=\frac{1}{N}\sum_{t=1}^{N}y(t)\]  
The mean square error, (%VAF), mean absolute error (MAE), mean absolute percentage error (MAPE), and the coefficient of determination (\(R^{2}\)) are given in Table 4. Again, it can be realized that the %VAF is close to 100% and \(R^{2}\) to unity. Additionally, the MAPE error is very small. These all confirm the precision of the Wiener Box-Jenkins model in modeling drug delivery. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**MSE** & \%**VAR** & **MAE** & **MAPE** & \(R^{2}\) \\ \hline
0.0127 & 99.9\% & 0.0331 & 0.0010 & 0.9997 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Mean square error (MSE), % Variance Accounted for, Mean Absolute Error (MAE), Mean Absolute Percentage Error (MAPE) and \(R^{2}\) averaged over 100 Monte Carlo simulations. \begin{table}
\begin{tabular}{c c} \hline \hline
**Parameter** & **Value** \\ \hline \(b_{0}\) & \(-0.0085\) \\ \(b_{1}\) & \(0.0028\) \\ \(b_{2}\) & \(0.0020\) \\ \hline \(f_{1}\) & \(0.0261\) \\ \(f_{2}\) & \(0.1744\) \\ \hline \(c_{1}\) & \(0.9926\) \\ \hline \(d_{1}\) & \(-1.0000\) \\ \hline \(\beta_{0}\) & \(100.0063\) \\ \(\beta_{1}\) & \(0.0703\) \\ \(\beta_{2}\) & \(0.0054\) \\ \(\beta_{3}\) & \(-0.0445\) \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Average estimates of the Wiener Box-Jenkins model parameters using PSO. Furthermore, the average measured and predicted output of NMB outputs are shown in Figure 5. It is clear that the PSO optimization-based prediction is close to measured output with MSE average cost function using 100 run is 0.0127.