# Bayesian Optimal Experimental Design for Race Tracking in Resin Transfer Moulding
## 3 Bayesian Formulation
### Bayesian Inference  
The objective of this investigation is to estimate the permeability vector \(\mathbf{k}\), which exists and produces a vector of measurements \(\mathbf{d}\), as the composite part is produced. For the RTM problem, the length of this vector is the number of measurement times multiplied by the number of pressure sensors. We assume that these data contain some error or noise \(\mathbf{e}\), so we have:  
\[\mathbf{d}=\mathcal{G}(\mathbf{k})+\mathbf{e},\quad\mathbf{e}\sim\mathcal{N}(\mathbf{0},\mathbf{ \Gamma}_{\mathbf{e}}), \tag{22}\]  
where \(\mathbf{\Gamma}_{\mathbf{e}}\) is a covariance matrix that describes the distribution of this error, and \(\mathcal{G}\) represents the 'forward model'. That is, \(\mathcal{G}(\mathbf{k})\) produces noise-free measurements that would be taken when completing an RTM resin injection with permeability vector \(\mathbf{k}\). The computational model described in Section 2 is used every time \(\mathcal{G}(\mathbf{k})\) is calculated.  
This estimation of \(\mathbf{k}\) can be achieved by Bayesian inference. We treat the unknown \(\mathbf{k}\) as a random variable and determine the posterior probability distribution \(\pi(\mathbf{k}|\mathbf{d})\). This has the added benefit of automatically quantifying the uncertainty in the parameters. The posterior can be found using [PERSON] rule:  
\[\begin{array}{ll}\pi(\mathbf{k}|\mathbf{d})&=\dfrac{\pi(\mathbf{d}|\mathbf{k})\pi(\mathbf{k})}{ \pi(\mathbf{d})}\\ &\propto\pi(\mathbf{d}|\mathbf{k})\pi(\mathbf{k}).\end{array} \tag{23}\]  
Here, \(\pi(\mathbf{d}|\mathbf{k})\) is the likelihood function, which is the probability of receiving the data for a given permeability vector. If we assume that the noise \(\mathbf{e}\) and the parameters \(\mathbf{k}\) are independent, and given Equation (22), this likelihood is [14]:  
\[\begin{array}{ll}\pi(\mathbf{d}|\mathbf{k})&\propto\exp\Bigl{(}-\tfrac{1}{2}( \mathcal{G}(\mathbf{k})-\mathbf{d})^{T}\mathbf{\Gamma}_{\mathbf{e}}^{-1}(\mathcal{G}(\mathbf{k})- \mathbf{d})\Bigr{)}\\ &=\exp\Bigl{(}-\tfrac{1}{2}||\mathbf{L}_{\mathbf{e}}(\mathcal{G}(\mathbf{k})-\mathbf{d})||^{2 }\Bigr{)}.\end{array} \tag{24}\]  
where \(\mathbf{\Gamma}_{\mathbf{e}}^{-1}=\mathbf{L}_{\mathbf{e}}^{T}\mathbf{L}_{\mathbf{e}}\).  
On the other hand, \(\pi(\mathbf{k})\) is the prior that encodes the prior beliefs of \(\mathbf{k}\). Given the parameterisation described in Section 3.1, it is now sensible to describe the prior using a multivariate Gaussian distribution with the mean \(\mathbf{\mu}_{k}\) and covariance \(\mathbf{\Gamma}_{\mathbf{k}}\). This gives the following equation for the prior probability density:  
\[\begin{array}{ll}\pi(\mathbf{k})&\propto\exp\Bigl{(}-\tfrac{1}{2}(\mathbf{k}-\mathbf{ \mu}_{k})^{T}\mathbf{\Gamma}_{\mathbf{k}}^{-1}(\mathbf{k}-\mathbf{\mu}_{k})\Bigr{)},\\ &=\exp\Bigl{(}-\tfrac{1}{2}||\mathbf{L}_{\mathbf{k}}(\mathbf{k}-\mathbf{\mu}_{k})||^{2}\Bigr{)},\end{array} \tag{25}\]  
where \(\mathbf{\Gamma}_{\mathbf{k}}^{-1}=\mathbf{L}_{\mathbf{k}}^{T}\mathbf{L}_{\mathbf{k}}\). Combining Equations (23)-(25) gives the following equation for the posterior:  
\[\pi(\mathbf{k}|\mathbf{d})\propto\exp\Bigl{(}-\frac{1}{2}||\mathbf{L}_{\mathbf{e}}(\mathcal{G} (\mathbf{k})-\mathbf{d})||^{2}-\frac{1}{2}||\mathbf{L}_{\mathbf{k}}(\mathbf{k}-\mathbf{\mu}_{k})||^{2} \Bigr{)} \tag{26}\]