# Gaussian Process Surrogates for Modeling Uncertainties in a Use Case of Forging Superalloys
## 2 GP based Surrogate Model
### Gaussian Process  
A GP is a generalization of the Gaussian distribution. The Gaussian distribution describes random variables or random vectors, while a GP describes functions \(f(x)\). In general, a GP is completely specified by its mean function \(m(x)\) and covariance function \(k(x,x^{\prime})\), also called kernel. If the function \(f(x)\) under consideration is modeled by a GP, we have  
\[\mathbb{E}[f(x)] =m(x) \tag{1}\] \[\mathbb{E}[(f(x)-m(x))(f(x^{\prime})-m(x^{\prime}))] =k(x,x^{\prime}) \tag{2}\]  
for all \(x\) and \(x^{\prime}\). Where \(x\) refers to training and \(x^{\prime}\) to test data. Thus, we can define the GP by  
\[f(x)\sim\mathcal{GP}(m(x),k(x,x^{\prime})). \tag{3}\]  
We use the following notation for explanatory purposes only in this section. Matrix \(D_{train}=(X,Y)\) contains the training data with input data matrix \(X=(x_{1},\dots,x_{n})\) and output data matrix \(Y=(y_{1},\dots,y_{n})\), and test data matrix \(D_{test}=(X^{\prime},Y^{\prime})\) contains the test data with \(X^{\prime}=(x^{\prime}_{n+1},\dots,x^{\prime}_{n+m})\) as input and \(Y^{\prime}=(y^{\prime}_{n+1},\dots,y^{\prime}_{n+m})\) as output. We define that they are jointly Gaussian and have zero mean with consideration of the prior distribution, further, we assume an additive independent identically distributed Gaussian noise with variance \(\sigma_{n}^{2}\) and identity matrix \(I\) for noisy observations:  
\[ \begin{bmatrix}Y\\ Y^{\prime}\end{bmatrix} \sim\mathcal{N}\bigg{(}0, \begin{bmatrix}k(X,X)+\sigma _{n}^{2}I&k(X,X^{\prime})\\ k(X^{\prime},X)&k(X^{\prime},X^{\prime})\end{bmatrix} \bigg{)} \tag{4}\]  
The GP predicts the function values \(Y^{\prime}\) at positions \(X^{\prime}\) in a probabilistic way, where, the posterior distribution can be fully described by the mean and the covariance. \[ \begin{split} Y^{\prime}|X^{\prime},X,Y\sim& \mathcal{N}(k(X^{\prime},X)[k(X,X)+\sigma_{n}^{2}I]^{-1}Y,\\ & k(X^{\prime},X^{\prime})-k(X^{\prime},X)[k(X,X)+\sigma_{n}^{2}I]^{-1}k( X,X^{\prime}))\end{split}  \tag{5}\]  
Figure 3: GP takes manufacturing process-specific parameters \(x_{m}\) and part specific parameters \(x_{p}\) as input and predicts the mean \(m(\mu)\) and epistemic uncertainty \(\sigma(\mu)\) of the manufacturing process result. Figure 2: GP takes manufacturing process parameters \(x_{m}\), part specific parameters \(x_{p}\) and aleatoric manufacturing process uncertainty \(\Sigma_{al}(Z)\) as input and predicts the mean \(m(\sigma_{al})\) and epistemic uncertainty \(\sigma(\sigma_{al})\) of the aleatoric uncertainty of the manufacturing process result. Resulting in mean  
\[m(Y^{\prime})=\mathbb{E}[Y^{\prime}|X,Y,X^{\prime}]=k(X^{\prime},X)[k(X,X)+\sigma _{n}^{2}I]^{-1}Y \tag{6}\]  
covariance  
\[COV(Y^{\prime})=k(X^{\prime},X^{\prime})-k(X^{\prime},X)[k(X,X)+\sigma_{n}^{2}I] ^{-1}k(X,X^{\prime}) \tag{7}\]  
and epistemic standard deviation \(\sigma\)  
\[\sigma(Y^{\prime})=\sqrt{\text{diag}(COV(Y^{\prime}))} \tag{8}\]  
where the diagonal of the covariance matrix \(COV\) is extracted as a vector and the square root is calculated for each element to determine the epistemic standard deviation \(\sigma\). It can be observed that the selection or design of the covariance function is the main ingredient when using GP regression. In the following, we describe the two covariance functions we use in our approach: the popular Radial Basis Function (RBF) (also called squared exponential covariance function)  
\[k_{\text{RBF}}(x,x^{\prime})=\exp\biggl{(}\frac{||x-x^{\prime}||^{2}}{l^{2}} \biggr{)} \tag{9}\]  
with characteristic length-scale parameter \(l\) and \(||\cdot||\) denoting the Euclidean distance and the Matern covariance function  
\[k_{\text{Matern}}(x,x^{\prime})=\frac{1}{\Gamma(\
u)2^{\
u-1}}\biggl{(}\frac{ \sqrt{2\
u}}{l}||x-x^{\prime}||\biggr{)}^{\
u}K_{\
u}\biggl{(}\frac{\sqrt{2\
u }}{l}||x-x^{\prime}||\biggr{)} \tag{10}\]  
with gamma function \(\Gamma\), modified Bessel function \(K_{\
u}\) and parameter \(\
u\) that controls the smoothness of the resulting function.