# Active Learning Strategy for Surrogate-Based Quantile Estimation of Field Function
## 4 Applications  
### Analytical Test Case  
#### 4.1.1 Test Case Description  
To illustrate the proposed active learning approach, first an analytical test case is defined as follows (with \(\mathbf{X}(\cdot,\cdot)\) a non-dimensional output):  
\[\mathbf{U}\sim\phi_{\mathbf{U}}\stackrel{{\mathcal{Q}_{\mathbf{X}}}} {{\longrightarrow}}\mathbf{X}(t,\mathbf{U})=\sqrt{U_{0}+5.}+(U_{1}\times\cos( U_{0}/10.)-39.24)\times(1-\exp(-t/4.0)) \tag{27}\]  
where \(\mathbf{U}=[U_{0},U_{1}]^{T}\) and \(t\in[0.,12.]\). Moreover, \(\mathbf{U}\sim\phi_{\mathbf{U}}\) with \(\phi_{\mathbf{U}}=\mathcal{N}(\mu_{\mathbf{U}},\Sigma_{\mathbf{U}})\) and \(\mu_{\mathbf{U}}=[100.,100. ]^{T},\Sigma_{\mathbf{U}}= \begin{bmatrix}20.&0\\ 0&10.\end{bmatrix} \). The objective is to estimate the 95% quantile \(q_{95}\) of the output stochastic process \(\mathbf{X}(t,\mathbf{U})\) with the proposed active learning approach. The initial input \(\mathcal{U}_{M}\) and output datasets \(\mathcal{X}_{M}\) are defined by a Monte-Carlo simulation with \(M=4\). For each realization of the input uncertain variables, the exact mapping \(\mathcal{Q}_{\mathbf{X}}\) is evaluated to determine the output stochastic process realization \(\mathbf{X}(t,\mathbf{u}_{i}),\ i=1,\ldots,M\). Then, 10 active learning iterations are carried out to enrich the input and output datasets in order to improve the estimation of the 95% quantile \(q_{95}\) with the surrogate model. An illustration of 200 output stochastic process realizations and the exact 95% quantile \(q_{95}\) are given in Figure 4. Figure 5 presents the scaled KL modes for the output stochastic process. To evaluate the uncertainty on the 95% quantile estimation, \(N_{GP}=150\) GP trajectories are sampled and \(\beta=0.025\) is used to define the upper and lower bounds on the quantile estimates in the set \(\mathbb{Q}_{N_{GP}}\). To assess the adequate Karhunen-Loeve decomposition, 1000 input variable samples are generated and the corresponding output stochastic process samples are estimated by running the model \(\mathcal{Q}_{\mathbf{X}}(\cdot)\). These samples are used as validation samples \(\mathbf{X}_{\triangleright}^{*}(t,\mathbf{u})\). Figure 3: Proposed active learning strategy for quantile estimation refinement for stochastic process defined over a mono-dimensional mesh domain. The truncation level in Karhunen-Loeve decomposition is a trade-off between the number of terms in the truncation and the accuracy of the resulting decomposition. The predictivity factor Q2 may be used to evaluate the accuracy of the KL expansion :  
\[Q2=1-\frac{\sum_{i=1}^{M_{v}}\left(\hat{X}(t,\mathbf{u}_{i})-X_{v}(t,\mathbf{u}_ {i})\right)^{2}}{\mathbb{V}[X_{v}(t,\mathbf{u})]} \tag{28}\]  
where \(M_{v}\) is the number of validation samples, \(X_{v}(t,\mathbf{u}_{i})\) the exact validation sample and \(\hat{X}(t,\mathbf{u}_{i})\) the KL expansion. The \(Q2\) factor allows to evaluate the adequacy between the KL expansion prediction and the some validation samples resulting from the exact function evaluations. In the following, different number of KL modes are considered in the decomposition to analyze the influence of the truncation. For each level of truncation, the residual samples are determined by evaluating the difference between the validation samples and the KL predictions using Equation (4). The residual samples are illustrated in red in Figure 6 along with the validation samples (in blue). It can be seen in Figure 6, that by considering only 1 mode in the KL expansion, the residual samples are non negligible. However, as the number of modes increases, the residual samples become negligible and the KL expansion provides an accurate prediction. Figure 4: Realizations of output stochastic process samples and exact \(q_{95}\) quantile. Figure 5: 13 scaled KL modes for the output stochastic process. Table 1 gives the Q2 factor according to the number of KL modes in the expansion. As expected from the Figure 6, with only 1 KL mode, the predictivity factor illustrates the poor accuracy of the KL decomposition.