# The Extreme Function Theory for Damage Detection: An Application to Civil and Aerospace Structures
## 2 Gaussian Processes and Extreme Function Theory
### The Gaussian Process (GP) Regression  
Being the mode shapes \(\mathbf{\varphi}\) a function of the space variable \(\mathbf{x}\), it is possible to define a GP prior over this latent variable, in the general form  
\[f(\mathbf{x})\,\sim GP\big{(}m(\mathbf{x}),k\big{(}\mathbf{x},\mathbf{x}^{\prime}\big{)}\big{)}, \tag{1}\]  
not dissimilarly from how a normal distribution is uniquely defined by its mean and variance, the GP of the general process \(\mathrm{f}(\mathbf{x})\) can be defined uniquely by its mean function  
\[m(\mathbf{x})=E[f(\mathbf{x})] \tag{2}\]  
and on the covariance matrix  
\[k\big{(}\mathbf{x},\mathbf{x}^{\prime}\big{)}=E\big{[}(f(\mathbf{x})-m(\mathbf{x}))\big{(}f \big{(}\mathbf{x}^{\prime}\big{)}-m\big{(}\mathbf{x}^{\prime}\big{)}\big{)}\big{]} \tag{3}\]  
where \(\mathrm{E}[\cdot]\) denotes the expectation. Throughout this whole discussion, a zero-mean and squared-exponential (SE) covariance function will be applied (the exact formulation will be discussed later; other less frequent options exist and a discussion on the topic can be found in Reference [29]). If \(\mathbf{f}=\mathrm{f}(\mathbf{x})\) indicates the set of the function values at the training points \(\mathbf{X}\) (note that the training vectors have been assembled into a matrix form) and \(\mathbf{f}^{*}\) a set of test outputs at a new set of points \(\mathbf{X}^{*}\), according to the zero-mean prior it is possible to define  
\[\left[ \begin{array}{c}\mathbf{f}\\ \mathbf{f}^{*}\end{array} \right]\,\sim\,\mathcal{N}\bigg{(}0,\left[ \begin{array}[] {cc}K(\mathbf{X},\mathbf{X})&K(\mathbf{X},\mathbf{X}^{*})\\ K(\mathbf{X}^{*},\mathbf{X})&K(\mathbf{X}^{*},\mathbf{X}^{*})\end{array} \right]\bigg{)}, \tag{4}\]  
where \(\mathrm{K}(\mathbf{X}^{*},\mathbf{X})\in\mathbb{R}^{n^{*}\times n}\) is a matrix with the terms defined by the covariances evaluated at all pairs of test and training points (the same applies for \(\mathrm{K}(\mathbf{X},\mathbf{X})\), \(\mathrm{K}(\mathbf{X},\mathbf{X}^{*})\), and \(\mathrm{K}(\mathbf{X}^{*},\mathbf{X}^{*})\)). The posterior distribution is defined by conditioning the joint prior on the observations, resulting (for an ideally noise-free scenario) in  
\[ \begin{array}{rcl}p(\mathbf{f}^{*}|\mathbf{X}^{*},\mathbf{X},\mathbf{f})\sim&\mathcal{N}\Big{(} K(\mathbf{X}^{*},\mathbf{X})K(\mathbf{X},\mathbf{X})^{-1}\mathbf{f},K(\mathbf{X}^{*},\mathbf{X}^{*})\\ &&-K(\mathbf{X}^{*},\mathbf{X})K(\mathbf{X},\mathbf{X})^{-1}K(\mathbf{X},\mathbf{X}^{*})\Big{)}.\end{array}  \tag{5}\]  
By considering the measurement noise as i.i.d. Gaussian noise \(\epsilon\) with variance \(\sigma_{n}^{2}\), one can define  
\[\mathbf{\varphi}=f(\mathbf{x})+\epsilon \tag{6}\]  
thus, Equation (5) becomes  
\[p(\mathbf{f}^{*}|\mathbf{X}^{*},\mathbf{X},\mathbf{\varphi})\sim\mathcal{N}(m(\mathbf{f}^{*}),cov( \mathbf{f}^{*})) \tag{7}\]  
with the predictive mean  
\[m(\mathbf{f}^{*})=K(\mathbf{X}^{*},\mathbf{X})\big{[}K(\mathbf{X},\mathbf{X})+\sigma_{n}^{2}\mathbf{I }\big{]}^{-1}\mathbf{\varphi} \tag{8}\]  
and the predictive covariance matrix  
\[cov(\mathbf{f}^{*})=K(\mathbf{X}^{*},\mathbf{X}^{*})-K(\mathbf{X}^{*},\mathbf{X})\Big{[}K(\mathbf{X}, \mathbf{X})+\sigma_{n}^{2}\mathbf{I}\big{]}^{-1}K(\mathbf{X},\mathbf{X}^{*})\Big{)}. \tag{9}\]  
At this point, it is evident that the only step remaining before obtaining the normality model is to define its covariance and the added noise. It was already assumed that this latter depends solely on \(\sigma_{n}^{2}\). In the simpler (i.e., 1-dimensional) case, the aforementioned SE covariance function can be formulated as  
\[k_{\varphi}\big{(}x_{p},x_{q}\big{)}=\sigma_{f}^{2}\exp\biggl{[}-\frac{1}{2l }\big{(}x_{p}-x_{q}\big{)}^{2}\biggr{]}+\sigma_{n}^{2}\delta_{p,q} \tag{10}\]  
where \(k_{\varphi}\) is the covariance of the noisy target set \(\mathbf{\varphi}\), \(\sigma_{f}^{2}\) is the variance of the function, \(l\) is the length-scale parameter, \(\delta_{p,q}\) is the Kronecker delta, and \(x_{p},x_{q}\) are the locations of the training data sets corresponding to the respective indices.