1.. Introduction {#s1}
================

The use of complex mathematical models for simulating and predicting the behaviour of physico-chemical processes is nowadays crucial in a broad range of groundwater disciplines, including contaminant transport and geological storage of CO~2~ in deep saline aquifers among many others. The complexity of these models normally involves the implementation of highly demanding and time-consuming numerical codes, and thus there is growing interest in designing faster and reliable statistical approximations of the computationally expensive simulators, so-called emulators.

The vast majority of physico-chemical processes in porous media can be successfully described using stochastic partial differential equations (SPDEs) (see \[[@RSOS171933C1]--[@RSOS171933C5]\]). One parameter of special relevance in these equations is the permeability of the porous medium used to describe the inherent random heterogeneity of the rock formation. Several researchers have shown in the past that although permeability values can exhibit large spatial variations, these variations are not entirely random but spatially correlated (e.g. \[[@RSOS171933C1]--[@RSOS171933C3]\]). It has been also shown through experimental validation that permeability fields can be successfully modelled using a log-Gaussian distribution assumption (e.g. \[[@RSOS171933C4]\]). For instance, Mara *et al.* \[[@RSOS171933C6]\] modelled strongly heterogeneous aquifers by using a stochastic Gaussian process (GP) for the log-transmissivity fields conditional on data sampled at a set of locations in an aquifer. One of the most extended possibilities to generate samples of a log-Gaussian random field is through Karhunen--Lo$\acute{e}$ve (KL) decompositions of the correlation function of the underlying Gaussian field evaluated at each of the grid points of the computational domain (see \[[@RSOS171933C5],[@RSOS171933C7]\]). These samples are represented by a sequence of indexed random coefficients in a finite series. An immediate consequence of this form of representation of the input fields is that the dimension of the stochastic input space is as high as the number of grid points in the computational domain. As an example, for standard meshes of size 50×50, 80×80 or 100×100 in a two-dimensional rectangular domain, we would need to deal with a few thousands of stochastic degrees of freedom (DoF) if we do not wish field variance preservation to become an issue. In other words, the hypothetical over-smoothing of the generated permeability fields caused by a further truncation of the original KL decomposition, if not handled properly, would lead to unrealistic results.

During the past decade, several high-dimensional model representation (HDMR) techniques, e.g. CUT-HDMR, adaptive HDMR and new truncated HDMR, have been developed to reduce the high-dimensionality of stochastic input spaces (see \[[@RSOS171933C8]--[@RSOS171933C12]\]). HDMR methods split the original high-dimensional model into a set of lower-dimensional sub-models leading to less computational effort when solving the resulting sub-models by any numerical method. One of the preferred methods to be complemented with HDMR techniques for solving high-dimensional SPDEs found in the literature is the stochastic collocation (SC) method in any of its variants, e.g. full-tensor product, Smolyak sparse grid etc. (see \[[@RSOS171933C11],[@RSOS171933C13]--[@RSOS171933C17]\]). The SC method became so popular because, besides providing fast convergence, it lies within the so-called non-intrusive methods for solving SPDEs, i.e. neither knowledge nor algebraic manipulation of the equations that will be solved is required, and thus researchers can use existing in-house or commercial numerical simulators to implement the method. However, for some groundwater models (e.g. \[[@RSOS171933C5],[@RSOS171933C7],[@RSOS171933C18]\]) the number of stochastic DoF needed for an acceptable resolution of the results is still prohibitive for this method. One of the alternatives to overcome the problem of high dimensionality in time-demanding groundwater model simulators is GP emulation \[[@RSOS171933C19]--[@RSOS171933C21]\].

There are several applications of GP emulation of multivariate simulators, for instance Bowman *et al.* \[[@RSOS171933C22]\] compared four different techniques for emulating multivariate outputs in atmospheric dispersion models. To the best of our knowledge, there are still a limited number of publications in the literature dealing with GP emulation of groundwater models in very high-dimensional input spaces (e.g. \[[@RSOS171933C5]\]). GP emulators for high-dimensional simulators also necessitate HDMR methods to overcome the limitations of Bayesian regression. These limitations frequently arise in the estimation of some of the model parameters (so-called hyperparameters) present in anisotropic covariance/correlation functions. The hyperparameters are *a priori* unknown and need to be estimated from the data provided by the simulator. The maximum-likelihood estimate (MLE) method has been extensively employed to find estimates of the hyperparameters (see \[[@RSOS171933C5],[@RSOS171933C23],[@RSOS171933C24]\]). Most of the optimization algorithms used to find the MLE (in our case by minimizing the negative log marginal likelihood), for instance steepest descent, conjugate gradient, Hessian-free Newton etc., are critically dependent on the selection of the initial guess to initialize the iterative algorithm. This sensitivity to the choice of the initial values might be, for instance, due to the existence of multiple local maxima in the marginal likelihood \[[@RSOS171933C21]\]. While these methods have been satisfactorily used to estimate hyperparameters defined in low-dimensional spaces, for high-dimensional spaces this has historically led to an optimization problem, and in most of the cases to complete failure. In groundwater models, GP emulators normally represent point correlation by using automatic relevance determination covariances \[[@RSOS171933C25]\], and for these cases, we propose a continuation algorithm for passing the right initial values to the MLE method in the successive iterations. This will overcome the optimization issue and will make feasible the MLE method for a moderate/high dimension of the input space.

The focus of this paper is the development of a new approach for constructing GP emulators to act as a *full* surrogate model for computationally expensive *spatial field* simulators defined in very high-dimensional input and output spaces, and in particular for groundwater model simulators. Note that standard *scalar* GP emulation has already been successfully applied to complex and time-consuming scalar valued simulators \[[@RSOS171933C5]\]. Thus, the inputs and outputs of the simulator considered here will be spatial fields defined in very high-dimensional input and output spaces. The GP emulator is able to reproduce (up to a predetermined level of accuracy) the work of the computer model much faster. This is of vital importance in applications such as uncertainty quantification, design optimization and decision theory, where a large number (sometimes millions) of calls to the numerical simulator are required in order to produce a critical assessment. The methodology of the empirical simultaneous GP model reduction (ESGPMR) approach presented in this paper consists of combining two main techniques. (i) We use the method proposed by Higdon *et al.* \[[@RSOS171933C26]\] to reduce the dimensionality of the output space by using principal component analysis (PCA) and separate independent GP emulators for the coefficients in the PCA basis. Higdon's approach has been successfully adapted to other applications, for example, Holden *et al.* \[[@RSOS171933C27]\] applied a variation of the method to high-dimensional climate model outputs. Bowman & Woods \[[@RSOS171933C22]\] adapted the method to the field of atmospheric dispersion by using the thin-plate splines technique. (ii) We capture the high-dimensional relationship between the simulator inputs and the coefficients of each of the vectors spanning the reduced output space by exploiting the properties of the KL decomposition of the input permeability fields and using cross-validation (CV). Thus, we find a subspace of the high-dimensional input space leading to an optimal representation of the GP model response surface. To test the GP emulation results, we take as reference (*true value*) a sample of 256 full numerical simulations. The simulations were obtained over 18 days of continuous intensive CPU computations on a 12-core Intel Xeon cluster processor. The time spent to compute the final prediction of the same 256 spatial fields with the ESGPMR approach on the same processor was 4 h.

The outline of this paper is as follows. In §[2](#s2){ref-type="sec"}, we introduce the computationally expensive numerical simulator of a convection and dissolution process in random heterogeneous porous media. In §[3](#s3){ref-type="sec"}, we describe the framework of the GP emulation methodology. We present the novel method for simultaneous input--output model dimension reduction and we detail how to properly estimate the hyperparameters of a high-dimensional space by using a continuation algorithm. In §[4](#s4){ref-type="sec"}, we test the GP model reduction methodologies with the model problem introduced earlier. Concluding remarks are provided in §[5](#s5){ref-type="sec"}.

2.. Mathematical model and numerical simulator {#s2}
==============================================

Dissolution of CO~2~ in deep saline aquifers is considered one of the most effective ways of carbon capture and storage \[[@RSOS171933C28]\]. The model studied here focusses on the hydrodynamical part of the problem by setting a model for CO~2~-loaded flows in an idealized two-dimensional geometry. It considers the impact of hydrodynamic dispersion (or dispersivity), permeability heterogeneity and isotropy in porous media on the development of convecting instabilities. For solving the resulting problem, the finite-element method (FEM) is employed. The existence of continuous bifurcations from the no-flow steady-state solutions of the problem adds additional challenge to the search of numerical solutions, and to overcome this an arclength continuation technique \[[@RSOS171933C29]\] is used in conjunction with the FEM.

2.1.. Convectively enhanced dissolution process in porous media {#s2a}
---------------------------------------------------------------

The dissolution of CO~2~ into the brine of the storage site causes an increase in the density of the mixture, leading the CO~2~ to sink while reacting with local rock minerals to become a solid carbonate \[[@RSOS171933C30]\]. This leads to the onset of convection rolls and the resulting mixing leads to a greater contact between the injected CO~2~ and local minerals, significantly enhancing the carbon capture. This process is known as convectively enhanced dissolution (C-ED) \[[@RSOS171933C31],[@RSOS171933C32]\].

In recent theoretical and numerical works (e.g. \[[@RSOS171933C32]--[@RSOS171933C34]\]), researchers have investigated the behaviour of CO~2~ in deep saline aquifers. These studies focussed on the understanding of a simplified and idealized case where the problem is reduced to the motion of a fluid through a porous medium and where the dispersive transport is based on pure molecular diffusion. This paper will take into account more characteristics of natural aquifers, namely the rock heterogeneity and the hydrodynamic dispersion. This later will be modelled by a dispersion tensor, **D**, dependent on the local Darcy velocity of the fluid **u** as follows \[[@RSOS171933C34]--[@RSOS171933C36]\]: $\textbf{D} = D_{m}\mathbb{I} + \beta_{T} \parallel \textbf{u} \parallel \mathbb{I} + (\beta_{L} - \beta_{T})({\textbf{u} \otimes \textbf{u}}/{\parallel \textbf{u} \parallel})$, where ⊗ represents the tensor product, $\mathbb{I}$ is the unit (identity) tensor, *D*~*m*~ is the molecular diffusion coefficient of the solute in the fluid and *β*~*L*~ and *β*~*T*~ are, respectively, the longitudinal and transverse dispersion coefficients, which satisfy *β*~*L*~≥*β*~*T*~≥0 \[[@RSOS171933C5],[@RSOS171933C37],[@RSOS171933C38]\].

We consider the C-ED process to occur in a two-dimensional domain representing a random, heterogeneous, isotropic porous medium of depth 2*H* and length *L*. The spatial variable is defined by **x**=(*x*,*z*) on the domain \[0,*L*\]×\[−*H*,*H*\]. The governing equations for this model are continuity ([2.1](#RSOS171933M2x1){ref-type="disp-formula"}), Darcy's Law ([2.2](#RSOS171933M2x2){ref-type="disp-formula"}) and convection--diffusion-reaction ([2.3](#RSOS171933M2x3){ref-type="disp-formula"}) \[[@RSOS171933C32],[@RSOS171933C33],[@RSOS171933C38]\]: $$\begin{matrix}
{\nabla \cdot \textbf{u} = 0,} \\
\end{matrix}$$ $$\begin{matrix}
{\textbf{u} = - \frac{K}{\mu}(\nabla P + \rho g\textbf{e}_{z})} \\
\end{matrix}$$ $$\begin{matrix}
{\qquad{and}\qquad\phi\frac{\partial C}{\partial t} + \textbf{u} \cdot \nabla C} & {= \phi\nabla \cdot (\textbf{D}\nabla C) - \gamma_{c}C,} \\
\end{matrix}$$where **e**~*z*~ is the outward-pointing unit vector along the ordinate axis, *C* is the concentration of dissolved CO~2~, **u**=(*u*~*x*~,*u*~*z*~) is the fluid velocity and *P* is the fluid pressure. The parameters *K*, *μ*, *ϕ*, *γ*~*c*~ and **g** are, respectively, the medium permeability field, the fluid viscosity, the rock porosity, the reaction rate and acceleration due to gravity. The solute undergoes a first-order reaction and is converted into an inert product with no effect on the solution density, thus the density of the fluid is linearized and takes the form, *ρ*=*ρ*~0~+*β*~*c*~*C*, where *ρ*~0~ and *β*~*c*~ are the density of the pure fluid and the volumetric expansion coefficient. This assumption allows us to use the Boussinesq approximation \[[@RSOS171933C32]\]. The boundary conditions for the above problem are: *C*(*x*,*z*=*H*)=*C*~0~ and *u*~*x*~(0,*z*)=*u*~*x*~(*L*,*z*)=*u*~*z*~(*x*,±*H*)=0, (∂*C*/∂*z*)(*x*,−*H*)=(∂*C*/∂*x*)(0,*z*)=(∂*C*/∂*x*)(*L*,*z*)=0.

The velocity field is represented by using a streamfunction, *Ψ*, formulation, *u*~*x*~=∂*Ψ*/∂*z* and *u*~*z*~=−∂*Ψ*/∂*x*. We can eliminate the pressure field from equation (([2.2](#RSOS171933M2x2){ref-type="disp-formula"})) by satisfying the mass conservation ([2.1](#RSOS171933M2x1){ref-type="disp-formula"}), resulting in a new set of equations for the unknown field variables (*Ψ*, *C*). For the resulting set of governing equations and boundary conditions we follow the same dimensionless formulation used in Crevillén-García *et al.* \[[@RSOS171933C5]\], where the reader can find a full detailed derivation of formulae and equations. The dimensionless variables and numbers are defined by: *x*′=*x*/*H*, *z*′=*z*/*H*, *Ψ*′=*Ψμ*/*HC*~0~*K*~0~*β*~*c*~*g*, *C*′=*C*/*C*~0~, *t*′=*tC*~0~*K*~0~*β*~*c*~*ρ*/*μϕH*, *β*′~*L*~=*β*~*L*~*C*~0~*K*~0~*β*~*c*~*g*/*D*~0~*μ*, *β*′~*T*~=*β*~*T*~*C*~0~*K*~0~*β*~*c*~*g*/*D*~0~*μ*, *K*′=*K*/*K*~0~, $\mathcal{L} = L/H$, *Ra*=*K*~0~*C*~0~*gβ*~*c*~*H*/*ϕμD*~0~ and *Da*=*γ*~*c*~*μH*/*K*~0~*C*~0~*gβ*~*c*~, where *β*~*T*~ and *β*~*L*~ are, respectively, the longitudinal and transverse dispersion coefficients \[[@RSOS171933C37],[@RSOS171933C38]\]; *K*~0~ and *D*~0~ are reference permeability and diffusion coefficients, respectively; $\mathcal{L}$ is the aspect ratio of the domain; *Ra* is the Rayleigh number, related to the buoyancy driven flow; and *Da* is the Damkhöler number, which is the ratio of the chemical reaction rate to the mass transfer rate \[[@RSOS171933C32]\]. In terms of these dimensionless variables and numbers, and dropping the primes for convenience, the following dimensionless governing equations defined in $\mathcal{R} = \lbrack 0,\mathcal{L}\rbrack \times \lbrack - 1,1\rbrack$ stay as: $$\frac{\partial}{\partial x}\left( \frac{1}{K}\frac{\partial\Psi}{\partial x} \right) + \frac{\partial}{\partial z}\left( \frac{1}{K}\frac{\partial\Psi}{\partial z} \right) + \frac{\partial C}{\partial x} = 0$$and $$\frac{\partial C}{\partial t} - \frac{\partial\Psi}{\partial z}\frac{\partial C}{\partial x} + \frac{\partial\Psi}{\partial x}\frac{\partial C}{\partial z} - \frac{1}{Ra}\left( \frac{\partial J_{x}}{\partial x} + \frac{\partial J_{z}}{\partial z} \right) + DaC = 0.$$

The Fickian mass flux **J**=(*J*~*x*~,*J*~*z*~) (Scheidegger-Bear) \[[@RSOS171933C38]\] satisfies **J**=**D**∇*C* and its components are expressed as follows: *J*~*x*~=(1+*β*~*T*~∥∇*Ψ*∥~2~)(∂*C*/∂*x*)+((*β*~*L*~−*β*~*T*~)/∥∇*Ψ*∥~2~)((∂*Ψ*/∂*z*)^2^(∂*C*/∂*x*)−(∂*Ψ*/∂*x*)(∂*Ψ*/∂*z*)(∂*C*/∂*z*)) and *J*~*z*~=(1+*β*~*T*~∥∇*Ψ*∥~2~)(∂*C*/∂*z*)+((*β*~*L*~−*β*~*T*~)/∥∇*Ψ*∥~2~)((∂*Ψ*/∂*x*)^2^(∂*C*/∂*z*)−(∂*Ψ*/∂*x*)(∂*Ψ*/∂*z*)(∂*C*/∂*x*)), where ∥⋅∥~2~ denotes the standard Euclidean norm. Finally, the corresponding dimensionless form of the boundary conditions is: *C*(*x*,1)=1, $\Psi(x, \pm 1) = \Psi(0,z) = \Psi(\mathcal{L},z) = 0$, $({\partial C}/{\partial z})(x, - 1) = ({\partial C}/{\partial x})(0,z) = ({\partial C}/{\partial x})(\mathcal{L},z) = 0$. In this study, we are interested in the long-term behaviour of the system and consequently we will restrict ourselves to the steady-state equations, i.e. by setting ∂*C*/∂*t*=0 in equation ([2.5](#RSOS171933M2x5){ref-type="disp-formula"}).

2.2.. Convectively enhanced dissolution numerical simulator {#s2b}
-----------------------------------------------------------

The numerical simulator is built based on an *H*^1^-conforming FEM \[[@RSOS171933C39]\], and the numerical solutions were computed on a shape-regular rectangular partition of $\mathcal{R} = \lbrack 0,\pi/2\rbrack \times \lbrack - 1,1\rbrack \subset \mathbb{R}^{2}$ comprising 2500 elements (i.e. a computational domain formed by *M*=2601 nodes), employing basis functions of polynomial degree 1. All computations were performed using the AptoFEM finite-element toolkit, documented in Antonietti *et al.* \[[@RSOS171933C40]\], together with the MUMPS linear solver \[[@RSOS171933C41],[@RSOS171933C42]\]. In terms of the CPU time spent by the numerical simulator to compute a single solution of equations ([2.4](#RSOS171933M2x4){ref-type="disp-formula"}) and ([2.5](#RSOS171933M2x5){ref-type="disp-formula"}), the choice of different values for the model parameters, *Ra* and *Da*, makes no difference. In this paper, we will restrict ourselves to the case $\mathcal{L} = \pi/2$, *Ra*=100, *Da*=0.1, *β*~*L*~=*π*/2 and *β*~*T*~=*β*~*L*~/10.

2.3.. Generation of random permeability fields {#s2c}
----------------------------------------------

Natural media is heterogeneous in a hierarchy of scales, and it is virtually impossible with today's technologies to resolve this heterogeneity in detail \[[@RSOS171933C43]\]. The permeability values have shown spatial correlation \[[@RSOS171933C1]--[@RSOS171933C3]\] and a function that has been extensively used \[[@RSOS171933C2],[@RSOS171933C5],[@RSOS171933C7],[@RSOS171933C18],[@RSOS171933C44],[@RSOS171933C45]\] to represent that correlation is the following squared exponential covariance function: $$c(\textbf{x}_{i},\textbf{x}_{j}) = \sigma^{2}\,\exp\left( \frac{- \parallel \textbf{x}_{i} - \textbf{x}_{j} \parallel_{2}}{\lambda} \right)\quad\textbf{x}_{i},\textbf{x}_{j} \in \mathcal{R},$$where *λ* represents the correlation length and *σ*^2^ the variance of the process.

The simulator described earlier necessitates the values of the permeability *K* at each of the *M* nodes of the computational domain in order to solve the problem. It is common in groundwater flow models \[[@RSOS171933C18]\] to model *K* as a log-Gaussian random field; this guarantees that *K*\>0 in $\mathcal{R}$. In this study, we will model the permeability as log-Gaussian permeability fields and generate samples of the permeability fields at the nodes with the following procedure \[[@RSOS171933C46]\]. Let $(\Omega,\mathcal{F},\mathbb{P})$ be a probability space. If we now let $\mathbf{Z} \sim \mathcal{N}(\mathbf{m},\textbf{C})$, i.e. $\mathbf{Z}:\Omega\rightarrow\mathbb{R}^{M}$ be a multivariate normally distributed random vector with mean and covariance $\mathbf{m} = {(m_{1},\ldots,m_{M})}^{\intercal} = \mathbb{E}\lbrack\mathbf{Z}\rbrack \in \mathbb{R}^{M}$, $\textbf{C} = \mathbb{E}\lbrack(\mathbf{Z} - \mathbf{m}){(\mathbf{Z} - \mathbf{m})}^{\intercal}\rbrack \in \mathbb{R}^{M \times M}$, respectively, where $m_{i} = \mathbb{E}\lbrack\mathbf{Z}(\mathbf{x}_{i})\rbrack = m(\mathbf{x}_{i})$, *C*~*ij*~=*c*(**x**~*i*~,**x**~*j*~), *i*,*j*=1,...,*M*. Then, given the set of nodes ${\{\textbf{x}_{i}\}}_{i = 1}^{M}$, the vector $\mathbf{Z}:={(Z(\mathbf{x}_{1}),\ldots,Z(\mathbf{x}_{M}))}^{\intercal}$ is a discrete Gaussian random field. Finally, we set $\mathbf{K} = \exp(\mathbf{Z})$ to obtain the desired discrete log-Gaussian permeability field, where each of the components of the vector $\mathbf{K} \in \mathbb{R}^{M}$ corresponds to the value of the permeability at a node of the computational domain.

To generate different samples of $\mathbf{Z}$, we will use the KL decomposition method (see \[[@RSOS171933C5],[@RSOS171933C7],[@RSOS171933C46],[@RSOS171933C47]\]. This method uses an eigen-decomposition of the covariance matrix **C** at the nodes which is then stored for future samples generation. Moreover, the KL expansion may be truncated, which leads to a reduced-dimensional formulation that is critical in the emulator construction. The KL decomposition method is summarized as follows.

The covariance matrix **C** is real-valued and symmetric, and therefore admits an eigen-decomposition \[[@RSOS171933C48]\]: $\textbf{C} = (\Phi\Lambda^{1/2}){(\Phi\Lambda^{1/2})}^{\intercal}$, where *Λ* is the *M*×*M* diagonal matrix of ordered decreasing eigenvalues *λ*~1~≥*λ*~2~≥⋯≥*λ*~*M*~≥0, and *Φ* is the *M*×*M* matrix whose columns ***ϕ***~*i*~, *i*=1,...,*M*, are the eigenvectors of *C*. Let $\xi_{i} \sim \mathcal{N}(0,1)$, *i*=1,...,*M*, be independent and identically distributed (i.i.d.) random variables. We can draw samples from $\mathbf{Z} \sim \mathcal{N}(\mathbf{m},\textbf{C})$ using the KL decomposition of $\mathbf{Z}$ using the following expression \[[@RSOS171933C46]\]: $$\mathbf{Z} = \mathbf{m} + \Phi\Lambda^{\frac{1}{2}}{(\xi_{1},\ldots,\xi_{M})}^{\intercal} = \mathbf{m} + \sum\limits_{i = 1}^{M}\sqrt{\lambda_{i}}\mathbf{\phi}_{i}\xi_{i}.$$The terms $\xi_{i} \sim \mathcal{N}(0,1)$ are called *KL coefficients*. To be consistent with the non-dimensional formulation of equations ([2.4](#RSOS171933M2x4){ref-type="disp-formula"}) and ([2.5](#RSOS171933M2x5){ref-type="disp-formula"}), we generate a set of log-Gaussian permeability fields with point-wise mean 1 by setting $\textbf{m} = - (\sigma/2)\mathbf{I}$. Let us define the random vector $\mathbf{\xi} \in \mathbb{R}^{M}$, distributed according to $\mathcal{N}(\textbf{0},\mathbf{I})$. The numerical simulator is considered as a mapping from $\mathbf{\xi} \in \mathbb{R}^{M}$ to $(C,\Psi) \in \mathbb{R}^{M} \times \mathbb{R}^{M}$. If we were interested only in one of the two simulator output fields, we could also consider the simulator as either *f*~*c*~:***ξ***↦*C* or *f*~*Ψ*~:***ξ***↦*Ψ*.

In the next section, we will describe how to build a GP emulator.

3.. Gaussian process emulation of spatial fields in complex simulators {#s3}
======================================================================

A GP emulator is a statistical approximation of the numerical simulator. In this paper, to build an emulator for a given simulator, we use GP regression methodologies consisting of establishing a prior specification of the functional form of the target simulator which is updated in the light of data provided by using Bayes' rule, which yields a posterior distribution that can be used for inference. That prior specification consists of providing the model with a mean, a covariance structure and a set of *observed values* (or *targets*) at carefully selected inputs, so-called *design points*. The pair formed by the design points and the observed values at such points is called the *training set*. The mean and covariance functions contain parameters, so-called hyperparameters, that need to be inferred from the training data by solving an optimization problem. For high-dimensional input spaces, the GP model would be impractical. To overcome this optimization issue, we developed an ESGPMR method based on Bayesian inference that is able to recursively find the lowest dimension of the input space for which the GP emulator response surface best approximates the numerical simulator. The method incorporates a continuation routine that helps the optimization algorithm used for the MLE estimates to find adequate initial values for the successive iterations. The continuation routine can be easily made extensive to any existing moderate-dimensional GP emulators that groundwater researchers using commercial GP toolboxes discarded because of the impossibility of estimating the hyperparameters appropriately. In the next section, we only give a brief description of the GP framework, stating our choices for the prior specifications of the GP model, the generation of the training data and the final predictive equations used to approximate the simulator. For a detailed description of conditional distributions and the derivation of the final formulae, we refer the reader to Rasmussen & Williams \[[@RSOS171933C21]\].

3.1.. Gaussian process emulation framework {#s3a}
------------------------------------------

In this section, we describe the general GP emulation methodology for scalar functions, to then extend it to vector functions in the next section. Let $g:\mathbb{R}^{M}\rightarrow\mathbb{R}$ be a scalar simulator. The aim of GP emulation is to learn the functional form of the target model *g*(⋅) in the light of a very reduced (due to the time-consuming simulator) set of data. The design points can be regarded as the locations (in the input space) at which we wish to obtain the values of *g*(⋅) to determine the sensitivity of the simulator to different inputs. An exhaustive explanation of the possible choice of design points is addressed in Sacks *et al.* \[[@RSOS171933C19]\]. To generate the set of design points, we simply spread the points to cover the input space, in this case $\mathbb{R}^{M}$. There are several methods of sampling the inputs, the most common of which are Latin hypercube sampling (LHS) \[[@RSOS171933C49],[@RSOS171933C50]\] and Sobol sequence sampling \[[@RSOS171933C51]\]. In this paper, guided by the successful results obtained in a previous work, we will use the latter. Given the particular definition of the inputs in our model simulator ($\mathbf{\xi} \sim {\mathcal{N}(\textbf{0},\mathbf{I})}$), one very intuitive way of building a set of *d* design points is to, first, use a Sobol sequence to generate *d* points in \[0,1\]^*M*^, and second, push the *d* points component-wise through the inverse cumulative distribution function of *M* random variables distributed according to $\mathcal{N}(0,\sigma_{d}^{2})$, with $\sigma_{d}^{2} \geq 1$, to, jointly, form the set of design points ${\hat{\mathbf{\xi}}}_{j} = {({\hat{\xi}}_{j}^{1},\ldots,{\hat{\xi}}_{j}^{M})}^{\intercal},\, j = 1,\ldots,d$. Note that by setting *σ*~*d*~\>1, we guarantee that the design points are spread enough in $\mathbb{R}^{M}$ to cover all the points sampled from the input distribution ($\mathcal{N}(\textbf{0},\mathbf{I})$), and therefore we will not be missing some key information about the simulator responses at points far from the mean of the input distribution.

Let us denote by *f*(⋅) the GP used to model *g*(⋅). For any $\mathbf{\xi},\mathbf{\xi}^{\prime} \in \mathbb{R}^{D}$, for some *D*≤*M*, the GP prior mean function is defined as: $m(\mathbf{\xi}):=\mathbb{E}\lbrack f(\mathbf{\xi})\rbrack$ and the covariance function as: $k(\mathbf{\xi},\mathbf{\xi}^{\prime}):=\mathbb{C}\text{ov}(f(\mathbf{\xi}),f(\mathbf{\xi}^{\prime})) = \mathbb{E}\lbrack(f(\mathbf{\xi}) - m(\mathbf{\xi}))(f(\mathbf{\xi}^{\prime}) - m(\mathbf{\xi}^{\prime}))\rbrack$, where $\mathbb{E}\lbrack f( \cdot )\rbrack$ and $\mathbb{C}\text{ov}( \cdot , \cdot )$ denote the expectation and covariance operators, respectively. One of the methods available in the literature to select the mean and covariance functions for a given model is CV (see \[[@RSOS171933C5]\]). However, the covariance chosen for this GP makes no difference to the scope of the approaches developed in this study, and thus, for simplicity, we will use a mean-zero function and the square exponential (SE) covariance which is given in terms of three hyperparameters as follows \[[@RSOS171933C21]\]: $$k(\mathbf{\xi},\mathbf{\xi}^{\prime}) = \sigma_{f}^{2}\exp( - \frac{1}{2}{(\mathbf{\xi} - \mathbf{\xi}^{\prime})}^{\top}\text{diag}(\ell_{1}^{- 2},\ldots,\ell_{D}^{- 2})(\mathbf{\xi} - \mathbf{\xi}^{\prime})) + \sigma_{n}^{2}\delta_{ij},$$where $\sigma_{f}^{2}$ is the process variance, ℓ=(ℓ~1~,...,ℓ~*D*~) is the length scale, $\sigma_{n}^{2}$ is the noise variance and *δ*~*ij*~ is the Kronecker delta. The hyperparameters are collectively represented by $\theta\theta = (\sigma_{f}^{2},\mathbf{\ell},\sigma_{n}^{2})$. Given the set of design points generated with the method described earlier, ${\hat{\mathbf{\xi}}}_{j} = {({\hat{\xi}}_{j}^{1},\ldots,{\hat{\xi}}_{j}^{M})}^{\intercal}$, *j*=1,...,*d*, we can define the design matrix as $\textbf{X} = \lbrack{\hat{\mathbf{\xi}}}_{1},{\hat{\mathbf{\xi}}}_{2},\ldots,{\hat{\mathbf{\xi}}}_{d}\rbrack$. To avoid numerical instabilities (ill-conditioning of the matrix system), an i.i.d. random noise $\epsilon_{j} \sim \mathcal{N}(0,\sigma_{n}^{2})$, where $\sigma_{n}^{2}$ is the variance in expression ([3.1](#RSOS171933M3x1){ref-type="disp-formula"}), is typically introduced into the model, and thus the observed values will take the form $y_{j} = f_{c}({\hat{\mathbf{\xi}}}_{j}) + \epsilon_{j}$, where *y*~*j*~ is the perturbed simulator output at the design point ${\hat{\mathbf{\xi}}}_{j} \in \mathbb{R}^{M}$. If we now write $\textbf{y} = {\lbrack y_{1},\ldots,y_{d}\rbrack}^{\intercal}$, we can define the *training set* as the pair $\mathcal{D} = \{\textbf{X,\ y}\}$. Once we have provided the model with a mean-zero function, the SE covariance function ([3.1](#RSOS171933M3x1){ref-type="disp-formula"}) and the training set $\mathcal{D}$, we can make predictions for new untested inputs $\mathbf{\xi}^{\ast} \in \mathbb{R}^{D}$ by using the predictive equations for GP regression \[[@RSOS171933C21]\]: $$m_{\mathcal{D}}(\mathbf{\xi}^{\ast}) = \Sigma(\mathbf{\xi}^{\ast},\textbf{X}){\lbrack\Sigma(\textbf{X},\textbf{X}) + \sigma_{n}^{2}\textbf{I}\rbrack}^{- 1}\textbf{y}$$and $$k_{\mathcal{D}}(\mathbf{\xi}^{\ast},\mathbf{\xi}^{\ast}) = k(\mathbf{\xi}^{\ast},\mathbf{\xi}^{\ast}) - \Sigma{(\mathbf{\xi}^{\ast},\textbf{X})}^{\intercal}{\lbrack\Sigma(\textbf{X},\textbf{X}) + \sigma_{n}^{2}\textbf{I}\rbrack}^{- 1}\Sigma(\mathbf{\xi}^{\ast},\textbf{X}),$$where the (*i*,*j*)th entry of $\Sigma(\mathbf{X},\mathbf{X}) \in \mathbb{R}^{d \times d}$ is given by $k({\hat{\mathbf{\xi}}}_{i},{\hat{\mathbf{\xi}}}_{j})$ and $\Sigma(\mathbf{\xi}^{\ast},\mathbf{X}) = {(k(\mathbf{\xi}^{\ast},{\hat{\mathbf{\xi}}}_{1}),\ldots,k(\mathbf{\xi}^{\ast},{\hat{\mathbf{\xi}}}_{d}))}^{\intercal}$. Expression ([3.2](#RSOS171933M3x2){ref-type="disp-formula"}) for the GP posterior mean $m_{\mathcal{D}}$ can be then used to emulate the simulator output at any new input ***ξ***\*, i.e. we can write $f(\mathbf{\xi}^{\ast}):=m_{\mathcal{D}}(\mathbf{\xi}^{\ast}) \approx g(\mathbf{\xi}^{\ast})$. Expression ([3.3](#RSOS171933M3x3){ref-type="disp-formula"}) provides the predictive variance in the estimation of the output.

3.2.. Reduced-rank approximation of the output space {#s3b}
----------------------------------------------------

In this section, we use the method proposed by Higdon *et al.* \[[@RSOS171933C26]\]. The idea is to use PCA to project the original simulator outputs onto a lower-dimensional space spanned by an orthogonal basis. This is done via singular value decomposition (SVD) as we detail later. Once in the PCA framework, the outputs can be expressed as a linear combination of PCA basis vectors (or the principal components (PCs)) with coefficients treated as independent univariate GPs with distinct sets of correlation lengths. This allows us to build separate GP emulators (as many as PCs considered) to estimate the coefficients of new outputs at untested inputs in the PCA basis. Then we use a linear map for reconstruction to the original output space. By using orthogonal projection, we guarantees a minimal average reconstruction error. The error considered for comparisons between two vectors throughout this paper will be the *L*^2^-norm relative error (RE) unless stated otherwise. For the two vectors **x**=(*x*~1~,...,*x*~*M*~) and **y**=(*y*~1~,...,*y*~*M*~), we define the *L*^2^-norm RE between **x** and **y** as $$\text{RE}(\textbf{x},\textbf{y}) = \frac{\parallel \textbf{x} - \textbf{y} \parallel_{2}}{\parallel \textbf{x} \parallel_{2}},$$where ∥**x**∥~2~ is the Euclidean norm.

Let us consider a simulator (e.g. *f*~*c*~) which receives inputs in $\mathbb{R}^{M}$ and returns outputs in $\mathbb{R}^{M}$ (instead of $\mathbb{R}$). Then the GP emulator described in §[(a)](#s3a){ref-type="sec"} would not work. Let $\mathbf{Y}$ be the *M*×*d* matrix with column *j* the *j*th run of the simulator. The dimension reduction in the output space can be described as follows: (i) Subtract off the mean for each dimension *M* to obtain the centred version of the matrix $\mathbf{Y}$, $\mathbf{Y}^{\prime}.$(ii) Multiply the centred matrix $\mathbf{Y}^{\prime}$ by the normalization constant $1/\sqrt{d - 1}$ to obtain $\mathbf{Y}^{''}$.(iii) Compute the SVD of $\mathbf{Y}^{''}$ and obtain the *M*×*M* matrix ***U*** whose columns $\mathbf{u}_{j},\, j = 1,\ldots,M$, are the PCs of the PCA basis.(iv) Project the original centred data into the orthonormal space to obtain the matrix of coefficients, ***α***=(*α*~*ij*~), *i*=1,...,*M*, *j*=1,...,*d*.An orthonormal basis for a lower-dimensional space of dimension *r*\<*M* is given by the first *r* PCs of ${\{\mathbf{u}_{j}\}}_{j = 1}^{M}$. Thus a *reduced-rank approximation* of $\mathbf{Y}^{''}$, ${\overset{\sim}{\mathbf{Y}}}^{''}$ can be obtained by using the first *r* columns of ***U*** and the first *r* rows of ***α***.

Now we can build *r* separate and independent GPs from the input space $\mathbb{R}^{M}$ to $\mathbb{R}$ as described in §[(a)](#s3a){ref-type="sec"} by generating also *r* separate training sets. In this case, the design points in all the training sets are the same, $\textbf{X} = {\{{\hat{\mathbf{\xi}}}_{j}\}}_{j = 1}^{d}$, with ${\hat{\mathbf{\xi}}}_{j} \in \mathbb{R}^{M}$, and the set of observed values are the coefficients of the PCs computed above, i.e. the first *r* rows of ***α***. Thus, for any untested input $\mathbf{\xi}^{\ast} \in \mathbb{R}^{M}$, we use expression ([3.2](#RSOS171933M3x2){ref-type="disp-formula"}) for each of the *r* GPs to estimate the *r* coefficients. These are then stored in vector form and can be mapped back to the original output space to obtain the final GP prediction $\textbf{y}^{\ast} \in \mathbb{R}^{M}$. We can test the accuracy in the prediction by running the numerical simulator at the same input ***ξ***\* and compare the result $\textbf{y}_{true} \in \mathbb{R}^{M}$ with **y**\*. Unfortunately for high-dimensional input spaces this approach is not valid and an additional input space dimension reduction must be performed.

In the next section, we propose a method for overcoming the limitation that GPs have in high-dimensional input spaces. This methodology is then combined with the output space reduction method above to build a GP emulator for the full simulator.

3.3.. The empirical simultaneous Gaussian process model reduction method {#s3c}
------------------------------------------------------------------------

Let us clarify the notation first. Suppose we have a set of *d* design points ${\hat{\mathbf{\xi}}}_{j}\, \in \mathbb{R}^{M}$ generated as described in §[(a)](#s3a){ref-type="sec"}. We run the simulator at those points to obtain the corresponding *true* *d* output fields **y**~1~,...,**y**~*d*~ where the fields **y**~*j*~ are reshaped to form the columns of the *M*×*d* outputs matrix $\mathbf{Y}$. Then we use the dimension-reduction method described in §[(b)](#s3b){ref-type="sec"} to obtain the PCA basis and the matrix of coefficients ***α***=(*α*~*ij*~), *i*=1,...,*M*, *j*=1,...,*d*. We denote by ${\overset{\sim}{\mathbf{Y}}}^{r}$ the reduced-rank approximation of $\mathbf{Y}$ obtained by considering the first *r*≤*M* PCs of the PCA basis whose columns ${\overset{\sim}{\textbf{y}}}_{j}^{r},\, j = 1,\ldots,d$ are the correspondent reduced-rank approximations of the observed fields **y**~*j*~, *j*=1,...,*d*. As we wish to reduce the dimension *M* of the original input space, let us define, for any *D*≤*M*, the training sets as: ${\{\mathcal{D}_{i}^{D} = (\mathbf{X}^{D},\mathbf{\alpha}_{i})\}}_{i = 1}^{r}$, where $\mathbf{X}^{D} = \lbrack{\hat{\mathbf{\xi}}}_{1}^{D},\ldots,{\hat{\mathbf{\xi}}}_{d}^{D}\rbrack$ is the truncated design matrix with *D* denoting the first *D* components used from the whole set of *M* (e.g. for ${\hat{\mathbf{\xi}}}_{1} = {(\xi_{1}^{1},\ldots,\xi_{1}^{D},\ldots,\xi_{1}^{M})}^{\intercal}$ we have ${\hat{\mathbf{\xi}}}_{1}^{D} = {(\xi_{1}^{1},\ldots,\xi_{1}^{D})}^{\intercal}$), and ***α***~*i*~=(*α*~*ij*~), *j*=1,...,*d*. The ESGPMR algorithm ([figure 1](#RSOS171933F1){ref-type="fig"}) can finally be described as follows: (i) Set accuracy tolerance *ε* and maximum dimension of the input space to be considered $D_{\max}$.(ii) Set *r*=1.(iii) Find a reduced-rank approximation ${\overset{\sim}{\mathbf{Y}}}^{r}$ of the original $\mathbf{Y}$ by using the first *r* PCs.(iv) Set $D = D_{\max}$.(v) Form the training sets ${\{\mathcal{D}_{i}^{D}\}}_{i = 1}^{r}$ and build *r* independent GPs (as described in §[(b)](#s3b){ref-type="sec"}). Follow the leave-one-out cross-validation (LOO-CV) approach and use the previous GPs to predict the fields at the leave-out points ${\hat{\mathbf{\xi}}}_{j}^{D},\, j = 1,\ldots,d$, and then check if the following expression holds: $$\text{RE}(\textbf{y}_{j},{\hat{\mathbf{y}}}_{j}^{D}) < \varepsilon,\quad\forall j = 1,\ldots,d,$$where **y**~*j*~ are the columns of $\mathbf{Y}$ (the true fields) and ${\hat{\mathbf{y}}}_{j}^{D}$ denotes the predicted field at point ${\hat{\mathbf{\xi}}}_{j}^{D}$.If expression ([3.5](#RSOS171933M3x5){ref-type="disp-formula"}) does not hold, set *r*=*r*+1 and go to (iii) (to refine the reduced-rank approximation error). If expression ([3.5](#RSOS171933M3x5){ref-type="disp-formula"}) holds, set $D = D_{\max} - 1$ and go to (v) (to reduce the dimension of the input space) until the expression does not hold, and then return *D* and *r*. Figure 1.ESGPMR algorithm for code implementation.

Note that the choices of *ε* and $D_{\max}$ are problem-dependent and completely heuristic. In the next section, we will discuss how to choose values for those tolerances by examining the data, although this ultimately depends on the end-user criteria.

3.4.. Leave-one-out cross-validation and hyperparameters estimation {#s3d}
-------------------------------------------------------------------

Estimates of the unknown hyperparameters $\theta\theta = (\sigma_{f}^{2},\mathbf{\ell},\sigma_{n}^{2})$ in expression ([3.1](#RSOS171933M3x1){ref-type="disp-formula"}) need to be inferred from the data provided to the model. This step is a crucial part of GP emulation. While this is quite simple to solve in one-dimensional problems, it really becomes an optimization issue when dimension increases. In this section, we describe how to estimate those parameters from the training set even if the dimension of the input space is large. To estimate the hyperparameters, we use a technique known as leave-one-out cross-validation (LOO-CV) (see \[[@RSOS171933C5],[@RSOS171933C21]\]). LOO-CV consists of using all training set data but one point (the *leave-out*) for training, and computing the model prediction error on the leave-out point. This process is repeated until all available *d* points have been exhausted. We use each of the *d* leave-out training sets and a conjugate gradient optimizer to obtain estimates of the hyperparameters by maximizing the log marginal likelihood ([3.6](#RSOS171933M3x6){ref-type="disp-formula"}) with respect to the hyperparameters: $$\log p(\textbf{y}|\textbf{X},\theta\theta) = - \frac{1}{2}\textbf{y}^{\intercal}{(\Sigma + \sigma_{n}^{2}\textbf{I})}^{- 1}\textbf{y} - \frac{1}{2}\log|\Sigma + \sigma_{n}^{2}\textbf{I}| - \frac{n}{2}\log 2\pi.$$The prediction errors during the LOO-CV scheme are quantified through the mean square error (MSE): $$\text{MSE} = \frac{1}{d}\sum\limits_{j = 1}^{d}{(y_{j} - m_{j})}^{2},$$where *m*~*j*~ is the predicted expected value given by expression ([3.2](#RSOS171933M3x2){ref-type="disp-formula"}) and *y*~*j*~ is the corresponding observed value both at the same (leave-out) input ${\hat{\mathbf{\xi}}}_{j}$. Note that the MSE depends only on the mean predictions, and thus, sometimes, different CV measures which also take into account predictive variances, such as the negative log validation density loss \[[@RSOS171933C21]\] or the Dawid score \[[@RSOS171933C52]\], might be preferred. For the purpose of this study, the MSE gives us the relevant information about the LOO-CV predictions we need for assessment. For an optimal performance of the optimization algorithm and for avoiding failure due to the existence of possible marginal likelihood multiple optima, a continuation routine must be included in all the independent GP emulators described earlier. This is straightforward and can be implemented as follows: (i) Consider the training sets as in §[(c)](#s3c){ref-type="sec"}, i.e. for any *D*≤*M*: ${\{\mathcal{D}_{i}^{D} = (\mathbf{X}^{D},\mathbf{\alpha}_{i})\}}_{i = 1}^{r}$. Without loss of generality, let us set *r*=1. The method is exactly the same for the other *r*−1 GPs.(ii) Estimate the hyperparameters by finding the MLE of expression ([3.6](#RSOS171933M3x6){ref-type="disp-formula"}) for the *D* one-dimensional problems until a maximum value $D_{\max}$ (large), i.e. by using the *D*th KL coefficient of each of the *d* design points in the training set. We obtain $\mathbf{\theta}^{(\text{ini})} = {(\sigma_{f}^{(\text{ini})},\mathcal{l}_{1}^{(\text{ini})},\ldots,\mathcal{l}_{D}^{(\text{ini})},\sigma_{n}^{(\text{ini})})}^{\intercal}$. Note that the importance here lies in the length scales arising from the anisotropic covariance function. Note also that we do not need to compute these values *a priori* and we can do each calculation just before each iteration as needed (depending on $D_{\max}$).(iii) Start the iteration over the number of KL coefficients *D*. For *D*=1 perform a LOO-CV scheme by using the values obtained in (ii) as initial guess for the estimation of hyperparameters to be used in the GP. Store the hyperparameters as $\theta\theta^{(1)} = {(\sigma_{f}^{(1)},\ell_{1}^{(1)},\sigma_{n}^{(1)})}^{\intercal}$.(iv) Repeat the iterations until $D = D_{\max}$, and for *D*\>2 take as initial guess the previous estimation of the hyperparameters in the lower-dimensional space and the first estimation obtained in (ii) for the next component. For example, for *θ*^(2)^ take as initial guess: ${(\sigma_{f}^{(1)},\ell_{1}^{(1)},\ell_{2}^{({ini})},\sigma_{n}^{(1)})}^{\intercal}$.Store the MSE for all the *D* iterations to examine convergence. By inspecting [figure 2](#RSOS171933F2){ref-type="fig"}, we can estimate a value for $D_{\max}$ and refine the model. Figure 2.MSE against the number of KL coefficients or input space dimension *D*. These data correspond to the emulation of the first PC component.

4.. Numerical results {#s4}
=====================

In this section, we discuss the results obtained by applying the reduction and GP emulation methods to the model problem introduced in §[2](#s2){ref-type="sec"}. Let us consider the numerical simulators *f*~*c*~:***ξ***↦*C* and *f*~*Ψ*~:***ξ***↦*Ψ* with $\mathbf{\xi} \in \mathbb{R}^{M}$, distributed according to $\mathcal{N}(\textbf{0},\mathbf{I})$. $C \in \mathbb{R}^{M}$ and $\Psi \in \mathbb{R}^{M}$ are the concentration and streamfunction, respectively. Let us show how we build the GP emulator for the concentration simulator *f*~*c*~. Exactly the same procedure applies to *f*~*Ψ*~. The first step is to build a training set. We generate *d*=256 points as described in §[(a)](#s3a){ref-type="sec"}, i.e. we use a Sobol sequence to generate *d* points in \[0,1\]^*M*^, and, second, push the *d* points component wise through the inverse cumulative distribution function of *M* random variables distributed according to $\mathcal{N}(0,\sigma_{d}^{2})$, with *σ*~*d*~=1.32, to, jointly, form the set of design points ${\hat{\mathbf{\xi}}}_{j},\, j = 1,\ldots,d$. For the choice of *σ*~*d*~, we tested the GP simulator for three different values: *σ*~*d*~=1.32 was the one providing more accuracy in the LOO-CV test. To exploit the properties of Sobol sequences and spread the points in the space in an optimal manner, it is recommended \[[@RSOS171933C53]\] that the generated samples are a power of 2. In this study, we use *d*=2^8^=256. A lower number of design points might be used with the same degree of accuracy in the results (see \[[@RSOS171933C5]\]), although as our decisions for the model specifications are based mainly in the LOO-CV technique, we need a relatively large amount of experimental data. For those design points we run the simulator and obtain the correspondent concentration fields $f_{c}({\hat{\mathbf{\xi}}}_{1}) = C_{1},\ldots,f_{c}({\hat{\mathbf{\xi}}}_{d}) = C_{d}$.

The key parameters used to characterize the heterogeneity of the porous medium appeared in expression ([2.6](#RSOS171933M2x6){ref-type="disp-formula"}). A detailed analysis of the impact of heterogeneity on the concentration profiles and the streamfunction fields has been conducted previously \[[@RSOS171933C5],[@RSOS171933C24]\]; in these earlier works, a measure of the amount of CO~2~ adsorbed through the top boundary in a process of CO~2~ storage is computed from both the heterogeneous case and the one for an equivalent homogeneous medium characterized by a constant permeability equal to the mean permeability in the domain. For our simulations, the value of *λ* will be set to *λ*=0.5. This value has been taken from the ranges suggested in the literature (see \[[@RSOS171933C18]\]). The existence of bifurcating branches of solutions in the C-ED model (see \[[@RSOS171933C32]\]), i.e. there is not always guarantee of a unique observed value at a single design point, might lead to inaccurate training data if large values of *σ*^2^ are considered and no classification techniques are employed \[[@RSOS171933C5]\]. Thus, for simplicity and without loss of generality, we will set *σ*^2^=0.1. Note that the choice of *σ*^2^ does not directly affect the applicability of the ESGPMR method proposed in this paper but the uniqueness of the simulator outputs. Consequently, the use of larger values for *σ*^2^ would probably necessitate using additional pre-processing tools to classify the variety of branches of observed data before forming the training set. This scenario has been treated in detail previously \[[@RSOS171933C5]\]. Note that for models where there is a one-to-one correspondence between inputs and outputs, the ESGPMR can be applied without restriction.

Once we have generated the training set and decided the prior specifications for the GPs, we use the ESGPMR algorithm to reduce the dimensionality of the input and output spaces in order to bring the original model to a more computationally tractable and accurate problem. Tables [1](#RSOS171933TB1){ref-type="table"} and [2](#RSOS171933TB2){ref-type="table"} show the results for different accuracy tolerances *ε* obtained from the set of concentration and streamfunction fields, respectively. It also shows the number of KL coefficients used for the input space, the number of PCs from the PCA basis for the output space and the overall relative (maximum) error achieved. We observe that (as one might expect) the more dimensions that are considered, the more accurate is the overall approximation of the GP emulator. This is also a sign that the ESGPMR algorithm is well designed. To set an optimal value for $D_{\max}$, we need to conduct a first experiment allowing $D_{\max}$ to be large enough to allow us to investigate, for instance by visual inspection, some signs or numerical evidence of convergence. [Figure 2](#RSOS171933F2){ref-type="fig"} provides us with a valuable information about the latter. For this model, a sensible value for $D_{\max}$ might be 100 (higher or lower values are at user discretion). Note that this limit is only illustrative as [figure 2](#RSOS171933F2){ref-type="fig"} is only considering the first GP emulator or *r*=1. Although the value of $D_{\max}$ is just a reference, using more DoF does not seem to be sensible as it could lead to additional numerical errors as well as an exponential increase of the computational cost. It is important to note that $D_{\max}$ is just a user's auto-imposed limit depending on the user's own computational resources, and therefore it is related to dimension reduction, while *ε* is related to the accuracy of the GP results. Thus, the choices of $D_{\max}$ and *ε* are made independently. In these terms, if the user has not reached the desired accuracy in the GP predictions for either a tolerance *ε* or a relatively large value of $D_{\max}$, it can be concluded that GP emulation is not *a priori* (one can always try with different prior mean, covariance or likelihood functions) a recommendable surrogate model for the numerical simulator. [Figure 3](#RSOS171933F3){ref-type="fig"} shows numerical evidence of how the reduction of the MSE depends on the number of PCs considered. [Figure 4](#RSOS171933F4){ref-type="fig"} shows the permeability field used to compute the concentration and the streamfunction outputs shown in figures [5](#RSOS171933F5){ref-type="fig"} and [6](#RSOS171933F6){ref-type="fig"}. [Figure 5](#RSOS171933F5){ref-type="fig"} shows the results obtained by using the GP emulator with *D*=82 and *r*=10 to predict the concentration output field at one untested point $\mathbf{\xi}^{\ast} \in \mathbb{R}^{M}$. The RE between the true and the reduced rank approximation was 0.005. The RE between the true and the predicted was 0.01. [Figure 6](#RSOS171933F6){ref-type="fig"} shows the results for the same input considered in [figure 5](#RSOS171933F5){ref-type="fig"}, where in this case the best resolution achieved was using *D*=55 and *r*=14. We highlight here that different values of *D* and *r* are needed for each GP emulator to achieve the desired tolerance, i.e. while for the concentration we needed *D*=5 and *r*=3 to achieve a tolerance of 0.05, for the streamfunction we needed *D*=55 and *r*=14. Furthermore, both algorithms were unable to refine further, and thus the lowest tolerances we could achieve in this study were *ε*=0.01 for the concentration and *ε*=0.05 for the streamfunction. Table 1.Relative errors between the true and reduced-rank approximation RE~*true*-*red*~ and between and the true and the predicted concentration fields RE~*true*-*pred*~ for three different tolerances *ε*. The numbers of PCs (PC) and KL coefficients (KL) used are also provided.*ε*PCKLRE~*true*-*red*~RE~*true*-*pred*~0.050350.0340.0470.0256140.0170.0230.01010820.0050.010 Table 2.Relative errors between the true and reduced-rank approximation RE~*true*-*red*~ and between and the true and the predicted streamfunction fields RE~*true*-*pred*~ for three different tolerances *ε*. The numbers of PCs (PC) and KL coefficients (KL) used are also provided.*ε*PCKLRE~*true*-*red*~RE~*true*-*pred*~0.100560.0690.0950.07510180.0360.0720.05014550.0170.048 Figure 3.MSE against the number of PCs or output space dimension *r*. These data correspond to a GP emulation with *D*=120. Figure 4.Permeability field used for the prediction of the concentration and streamfunction fields shown in figures [5](#RSOS171933F5){ref-type="fig"} and [6](#RSOS171933F6){ref-type="fig"}. Figure 5.True (*a*), reduced rank (*b*) and predicted (*c*) concentration fields for the permeability shown in [figure 4](#RSOS171933F4){ref-type="fig"}. The dimension of the input (*D*) and output (*r*) spaces and the relative error (RE) achieved are also reported. Figure 6.True (*a*), reduced rank (*b*) and predicted (*c*) streamfunction fields for the permeability shown in [figure 4](#RSOS171933F4){ref-type="fig"}. The dimension of the input (*D*) and output (*r*) spaces and the relative error (RE) achieved are also reported.

Before finishing this section, let us see another application. We can use the GP emulator to approximate scalar-valued quantities of interest from any of the output fields, for instance we can compute the total mass of dissolved solute in the domain $\mathcal{R}$ given by BarbaRossa *et al*. \[[@RSOS171933C34]\]: $\mathcal{M} = \int_{\mathcal{R}}C$. In this case, we only need to emulate the concentration field *C* for the new input and then compute the integral over $\mathcal{R}$. An intuitive and qualitative way of measuring how close our GP predictions are to the observed values is through *scatterplots*. This consists of plotting the pairs (predicted outputs, observed outputs) along with the line *y*=*x* and checking that the scattered points are not 'far away' from the straight line. For this application, we used the data stored during the LOO-CV scheme for the GP above and computed the set $\mathcal{M}_{1}^{\ast},\ldots,\mathcal{M}_{d}^{\ast}$ from the emulated concentration fields. Then we computed $\mathcal{M}_{1},\ldots,\mathcal{M}_{d}$ directly from the simulator concentration outputs *C*~1~,...,*C*~*d*~. [Figure 7](#RSOS171933F7){ref-type="fig"} shows the scatterplot for the observed values (*Y*-axis) against the predicted values (*X*-axis). Figure 7.Scatterplot of the mass computed from the 256 observed concentration fields in the training set and the predicted mass obtained from the emulated concentration fields at the same design points. The line *y*=*x* is used as the reference for the best possible performance.

In this study, the GP emulation was implemented using the GPML MATLAB T[oolbox]{.smallcaps} v.3.4 \[[@RSOS171933C21]\].

5.. Conclusion {#s5}
==============

In this paper, we developed a methodology based on dimensionality reduction and GP emulation for surrogate modelling in SPDEs. The technique can be applied without modification to any model involving vector-valued functions and vector-valued inputs. The ESGPMR algorithm was able to simplify the original mathematical problem while retaining the accuracy in the results. In particular, for the emulation of concentration fields, one of the GP emulators was able to reduce the dimensionality of the input and output spaces from *M*=2601 to *D*=112 and from *M*=2601 to *r*=20, respectively, for an overall tolerance of *ε*=0.01.

The ESGPMR algorithm provides the end-user with a tool for assessing if GP emulation is an efficient surrogate model for a given computationally expensive numerical simulator. This applies to either numerical models where it is not feasible to meet the desired resolution in the GP predictions or when the original problem cannot be adequately reduced to a more tractable model (i.e. $D_{\max}$ and *r* are found to be extremely large for the tolerances given).

Data accessibility {#s6}
==================

Our data are available in Dryad at <https://doi.org/10.5061/dryad.3g280> \[[@RSOS171933C54]\].

Competing interests {#s7}
===================

The author declares that there are no competing interests.

Funding {#s8}
=======

This research was funded by the EU Panacea project, FP7, grant agreement 282900.
