# State and Parameter Estimation of a Mathematical Carcinoma Model under Chemotherapeutic Treatment
## 2 Materials and Methods
### Extended Kalman Filter  
For nonlinear systems one of the most widely applied observer is the EKF. First, assume a general system given in the form of:  
\[\dot{\mathbf{x}}(t) = f(\mathbf{x}(t),\mathbf{u}(t))+\mathbf{w}(t), \tag{4}\] \[\mathbf{y}(t) = h(\mathbf{x}(t),\mathbf{u}(t))+\mathbf{v}(t), \tag{5}\]  
where \(f\) describes the nonlinear system dynamics, \(h\) is the output equation, \(\mathbf{w}\) is the additive process noise or disturbance and \(\mathbf{v}\) is the measurement noise. Equation (4) is generalized further with the augmentation of system parameters \(\mathbf{x}:=[\mathbf{x}_{s}\;\mathbf{x}_{p}]^{\intercal}\;s.t.\;\dot{\mathbf{x }}_{p}=\mathbf{0}\), where \(\mathbf{x}_{s}\) is the original state vector and \(\mathbf{x}_{p}\) is the parameter vector.  
Since the measurements are done only at discrete times, continuous-discrete EKF has been applied. In the prediction step the model and covariances are propagated using the forward Euler method with shorter sampling times. The equations of the prediction step in time instant \(t\) are defined as  
\[\dot{\mathbf{x}}(t) = f(\mathbf{x}(t),\mathbf{u}(t)), \tag{6}\] \[\mathbf{y}(t) = h(\mathbf{x}(t),\mathbf{u}(t)),\] (7) \[\dot{\mathbf{P}}(t) = \mathbf{F}(t)\mathbf{P}(t)+\mathbf{P}(t)\mathbf{F}^{\intercal}( t)+\mathbf{Q},\] (8) \[\mathbf{F}(t) = \frac{\partial f}{\partial\mathbf{x}}\Big{|}_{\mathbf{x}(t), \mathbf{u}(t)} \tag{9}\]  
where \(\mathbf{P}\) is the error covariance matrix, \(\mathbf{F}\) is the Jacobian matrix of the system and \(\mathbf{Q}\) is the process noise covariance matrix. The update step in the \(k\)-th discrete step is defined by  
\[\mathbf{K}[k] = \mathbf{P}[k^{\prime}]\mathbf{H}^{\intercal}[k]\big{(}\mathbf{H }[k]\mathbf{P}[k^{\prime}]\mathbf{H}^{\intercal}[k]+\mathbf{R}\big{)}^{-1}, \tag{10}\] \[\mathbf{x}[k] = \mathbf{x}[k^{\prime}]+\mathbf{K}[k]\big{(}\mathbf{z}[k]-h( \mathbf{x}[k^{\prime}])\big{)},\] (11) \[\mathbf{P}[k] = \big{(}\mathbf{I}-\mathbf{K}[k]\mathbf{H}[k]\big{)}\mathbf{P}[k^ {\prime}],\] (12) \[\mathbf{H}[k] = \frac{\partial h}{\partial\mathbf{x}}\Big{|}_{\mathbf{x}[k^{ \prime}]} \tag{13}\]  
where \(\mathbf{K}\) is the Kalman gain, \(\mathbf{H}\) is the Jacobian of the \(h\) output equation, \(\mathbf{z}\) is the measurement, \(\mathbf{R}\) is the measurement noise covariance matrix and the aposthrope \(k^{\prime}\) indicates the a priori values of the update step. The transition from the continuous time domain to the discrete is given by: \(\mathbf{x}[k^{\prime}]=\mathbf{x}(t_{k})\).  
The EKF structure has been implemented using the model (1)-(3), extended with parameter estimation. The estimated parameters were selected in accordance with a previous sensitivity and identifiability analysis [16]. The results of the analysis indicate that the most sensitive parameters are \(a\), \(b\), \(n\) and\(w\), thus \(\mathbf{x}_{p}:=[a,b,n,w]^{\intercal}\). The identifiability analysis with the subset of parameters resulted in a structurally locally identifiable [17] system. This indicates that there is a finite number of parameter sets producing the same trajectories. For the developments of the observers the following assumption is used: \(\mathbf{w}=[\mathbf{w}_{s}\;\mathbf{w}_{p}]^{\intercal}\;s.t.\;\mathbf{w}_{s} =\mathbf{0}\). Practically speaking, it is assumed that the mismatch between the measurements and the model rises only from measurement noise and parameter uncertainty. With the augmented state vector the Jacobians are given as:\[\mathbf{F}=\begin{bmatrix}x_{4}-x_{5}-\frac{x_{6}x_{3}}{ED_{0}+x_{3}}&0&-x_{6} \frac{x_{1}ED_{50}}{(ED_{0}+x_{3})^{2}}&x_{1}&-x_{1}&-\frac{x_{1}x_{3}}{ED_{50}+ x_{3}}&0\\ x_{5}+\frac{x_{6}x_{3}}{ED_{0}+x_{3}}&x_{7}&x_{6}\frac{x_{1}ED_{50}}{(ED_{50}+x_{3}) ^{2}}&0&x_{1}&\frac{x_{1}x_{3}}{ED_{50}+x_{3}}&-x_{2}\\ -b_{k}\frac{x_{3}}{ED_{50}+x_{3}}&0&-c\frac{K_{B}}{(K_{B}+x_{3})^{2}}-\frac{b_ {k}x_{1}ED_{50}}{(ED_{50}+x_{3})^{2}}&0&0&0\\ 0&\cdots&&0\\ \vdots&&\ddots&&\vdots\\ 0&&\cdots&&0\end{bmatrix}, \tag{14}\] \[\mathbf{H}=\begin{bmatrix}1&1&0&0&0&0&0\end{bmatrix}. \tag{15}\]