1 Introduction

Conditional simulations of categorical spatial variables in geostatistics are used to quantify spatial uncertainty relevant to variety of applications, such as environmental, groundwater, mineral, and oil/gas (Mariethoz and Caers 2014; Armstrong et al. 2011; Chiles and Delfiner 2012; Lantuejoul 2002; Deutsch 2002; Goovaerts 1998). Methods can be pixel-based, object-based or surface-based, although eventually all the results are rastered on a discrete mesh. In terms of pixel-based (or mesh-based) methods, one has variogram-based methods (Journel 1983; Deutsch 2006; Emery 2007), Markov-random field methods (Li 2007; Daly 2005; Elfeki and Dekking 2001; Tjelmeland and Besag 1998), and multiple-point-geostatistics methods (Strebelle 2002; Zhang et al. 2006; Arpat and Caers 2007; Mariethoz et al. 2010; Honarkhah and Caers 2010). Other works that deal with the problem of simulation of categorical spatial variables include methods based on spin models and maximum entropy (Žukovič and Hristopulos 2009; Bogaert and Gengler 2018). Conditioning to exact observations (hard data) is often easily achieved, simply because the central value to be simulated on a mesh is taken to be the same support as the hard data. Conditioning in object-based or surface-based methods is more challenging, since an object or surface is represented as a shape or geometry rather than a regular mesh. Additionally, object-based methods are more sensitive to any inconsistency between the hard data and the a-priori choice of model parameterization. Example of surface-based methods are those that involve physical processes in addition to a stochastic component. Physical processes such as sediment transport or geomorphology create surfaces, not regular meshes. Representing and conditioning these surfaces to exact observations remains challenging.

Object-based, surface-based, and process-based models often cannot be fully conditioned to hard data, in particular dense hard data; conditioning remains partial. In this paper, we leverage on an ensemble of partially conditioned (or unconditional) categorical realizations generated by this kind of approaches and develop a method that creates conditional categorical simulations, without applying the original simulation method. Our idea relies on implicit functions. Implicit functions, sometimes also termed level set functions, represent surfaces (boundaries) by means of an additional dimension. For example, signed distance functions model the distance to a surface (boundary), adjusted by a sign to indicate inside/outside or above/below. This means that implicit functions transform and parameterize a 2D surface into a 3D mesh. We then use principal component analysis to create an orthogonal parameter representation of the implicit unconditional realizations. We show how the conditioning problem can be formulated as an inequality problem on the principal component scores. To then sample conditional realizations, we first sample principal component score from a multivariate Gaussian distribution with linear inequality constraints. The latter can also be seen as a truncated multivariate Gaussian distribution subject to linear inequalities constraints. Since the principal component orthogonalization and the signed distance function transformations are bijective, we can easily reconstruct conditional simulation, without applying the original simulation method.

The remainder of the paper is structured in the following manner. Sect. 2 details the proposed conditional simulation method through its basic ingredients. Section 3 analyzes the method on simple synthetic cases; in particular, the trade-off between the number of hard data and the number of unconditional categorical simulations is studied. Section 4 presents a real application in 3D to showcase the effectiveness of the proposed approach. A comparison with the classical sequential indicator simulation (SIS) is carried out. Section 5 outlines concluding remarks and suggestions for future work.

2 Methodology

Let \(\{C({\mathbf {x}}),{\mathbf {x}} \in D\}\) be the categorical spatial variable of interest defined on a fixed continuous spatial domain of interest \(D \subset \mathbb {R}^p\), with a finite set of possible categorical outputs (categories) \(\{c_1,\ldots ,c_K\}\) which are mutually exclusive and collectively exhaustive. The categorical spatial variable of interest is observed at a set of n distinct locations \({\{{\mathbf {x}}_i \in D\}}_{i=1,\ldots ,n}\). Consider an ensemble of L partially conditioned or unconditional categorical realizations \({\{C_U^{(l)}({\mathbf {x}}), {\mathbf {x}} \in D\}}_{l=1,\ldots ,L}\). Given this latter, the goal is to generate categorical realizations \({\{C_C^{(t)}({\mathbf {x}}), {\mathbf {x}} \in D\}}_{t=1,\ldots ,T}\) that honor the data \({\{C({\mathbf {x}}_i)\}}_{i=1,\ldots ,n}\), i.e., \(C_C^{(t)}({\mathbf {x}}_i)=C({\mathbf {x}}_i), \ i=1,\ldots ,n\). This section is devoted to the description of the different ingredients required to implement the proposed conditioning method. This latter has been implemented in R environment (R Core Team 2020). The simulation of unconditional categorical realizations is not the concern here.

2.1 Implicit functions

Consider a bounded domain \(\varOmega\) in an area of interest \(D \subset \mathbb {R}^p\) as illustrated on Fig. 1 (Zhou et al. 2016). Any point \({\mathbf {x}} \in D\) can obviously be classified into three parts: the interior or inside (\(\varOmega ^-\)), the exterior or outside (\(\varOmega ^+\)), and the boundary or surface (\(\partial \varOmega\)). The \((p-1)\) dimensional boundary \(\partial \varOmega\) can be represented as the zero isocontour of a scalar function \(\phi (\cdot )\) in \(\mathbb {R}^p\), called implicit function or level set function: \(\partial \varOmega =\{{\mathbf {x}} \in D, \phi ({\mathbf {x}})=0\}\). The implicit function \(\phi (\cdot )\) defines the boundary \(\partial \varOmega\) as well as the regions \(\varOmega ^-\) and \(\varOmega ^+\) : \(\varOmega ^-=\{{\mathbf {x}} \in D, \phi ({\mathbf {x}})<0\}\) and \(\varOmega ^+=\{{\mathbf {x}} \in D, \phi ({\mathbf {x}})>0\}\).

The signed distance function (SDF) is a subclass of implicit functions defined as (Osher and Fedkiw 2002):

$$\begin{aligned} \varphi ({\mathbf {x}})= {\left\{ \begin{array}{ll} -d({\mathbf {x}}), &{} \text{ if } {\mathbf {x}} \in \varOmega ^- \\ 0, &{} \text{ if } {\mathbf {x}} \in \partial \varOmega \\ d({\mathbf {x}}), &{} \text{ if } {\mathbf {x}} \in \varOmega ^+ \end{array}\right. }, \end{aligned}$$
(1)

where \(d({\mathbf {x}})\) denotes the minimum distance of \({\mathbf {x}}\) to \(\partial \varOmega\): \(d({\mathbf {x}})=\min _{{\mathbf {y}} \in \partial \varOmega }\Vert {\mathbf {x}}-{\mathbf {y}}\Vert\).

Thus, \(\varphi (\cdot )\) takes on the distance from the boundary \(\partial \varOmega\) with a sign depending on being inside or outside the domain \(\varOmega\). Signed distance functions are a subset of implicit functions having the property of unit gradient module with \(\Vert \nabla d(\cdot )\Vert =1\). Geometrically, it means that the \(\delta\) isocontour of the signed distance function is the offset of its zero isocontour along the normal direction and the offset distance equals \(\delta\). Figure 2 shows two examples of boundaries and their corresponding signed distance functions on a 2-dimensional grid. Signed distance values along the boundary is equal to zero. Signed distance values inside the boundary are negative while signed distance values outside the boundary are positive.

Fig. 1
figure 1

Representation of a boundary \(\partial \varOmega\) as well as regions \(\varOmega ^-\) and \(\varOmega ^+\) by means of an implicit function \(\phi (\cdot )\)

Fig. 2
figure 2

Examples of boundaries (in black) and their associated signed distance functions (map) \(\varphi (\cdot )\)

The categorical spatial variable of interest \(\{C({\mathbf {x}}),{\mathbf {x}} \in D\}\) with K categories \(\{c_1,\ldots ,c_K\}\) can also be seen as a variable that creates distinct boundaries or surfaces in the spatial domain D. Implicit functions such as the signed distance functions are used to describe the categories. Each category \(c_k (k=1,\ldots , K)\) is represented by a signed distance function \(\varphi _k (\cdot )\) such that: \(c_k=\{{\mathbf {x}} \in D, \varphi _k ({\mathbf {x}})<0\}\) and its boundary \(\partial c_k=\{{\mathbf {x}} \in D, \varphi _k({\mathbf {x}})=0\}\). This means that any categorical realization, whether pixel-based, object-based or surface-based can be parameterized using signed distance functions. A categorical hard datum at location \({\mathbf {x}}\) then indicates the sign of all signed distance functions at \({\mathbf {x}}\). Additionally, the indicator notation is used to denote the presence or absence of a category \(c_k\) at a location \({\mathbf {x}} \in D\):

$$\begin{aligned} I_{k}({\mathbf {x}})={\left\{ \begin{array}{ll} 1, &{} \text{ if } C({\mathbf {x}})=c_k \\ 0, &{} \text{ if } C({\mathbf {x}})\ne c_k \end{array}\right. }, \text{ and } I_{k}({\mathbf {x}})=1 \text{ implies } \text{ that } I_{k^{\prime }}({\mathbf {x}})=0 \quad \forall k^{\prime }\ne k; k=1,\ldots ,K. \end{aligned}$$
(2)

The categorical spatial variable of interest \(\{C({\mathbf {x}}),{\mathbf {x}} \in D\}\) with K categories can be transformed into a set of K signed distance functions \(\displaystyle {{\left\{ \varphi _k({\mathbf {x}}),{\mathbf {x}} \in D\right\} }_{k=1,\ldots ,K}}\) using the signed distance transform approach (Grevera 2007; Davies 2012). Each category \(c_k\) defines a p-dimensional binary image \(\{I_k({\mathbf {x}}),{\mathbf {x}} \in D\}\) where each point (pixel) has either a value of 1 indicating the presence of the category \(c_k\) or a value of 0 indicating the absence of the category \(c_k\). For every point (pixel) set to 1, a distance transform assigns a value indicating the negatively signed distance from that point (pixel) to the nearest point (pixel) set to 0. Similarly for every point (pixel) set to 0, a distance transform assigns a value indicating the positively signed distance from that point (pixel) to the nearest point (pixel) set to 1. Additionally, the signed distance transformation is one-to-one. The bijectivity is obtained using the following rule:

$$I_{k} ({\mathbf{x}}) = \left\{ {\begin{array}{*{20}l} {1,} \hfill & {{\text{if}}\;\varphi _{k} ({\mathbf{x}}) = \min \left( {\varphi _{1} ({\mathbf{x}}), \ldots ,\varphi _{K} ({\mathbf{x}})} \right)} \hfill \\ {0,} \hfill & {{\text{otherwise }}} \hfill \\ \end{array} } \right.,\quad \forall {\mathbf{x}} \in D,\;k = 1, \ldots ,K.{\text{ }}$$
(3)

Equivalent to

$$\begin{aligned} C({\mathbf {x}})={\mathop {{{\,\mathrm{arg\,min}\,}}}\limits _{c_1,\ldots ,c_k}}\left( \varphi _1({\mathbf {x}}),\ldots ,\varphi _K({\mathbf {x}})\right) , \ \forall {\mathbf {x}} \in D. \end{aligned}$$
(4)

2.2 Principal component analysis (PCA)

By applying the signed distance transform approach described in Sect. 2.1, the ensemble of L unconditional categorical realizations \({\{C_U^{(l)}({\mathbf {x}}), {\mathbf {x}} \in D\}}_{l=1,\ldots ,L}\) is transformed into an ensemble of L unconditional signed distance realizations \({\left\{ \varphi _{U_k}^{(l)}({\mathbf {x}}),{\mathbf {x}} \in D\right\} }_{l=1,\ldots ,L}\) for each category \(c_k (k=1,\ldots ,K)\). Principal component analysis (PCA) performed on each ensemble \({\left\{ \varphi _{U_k}^{(l)}({\mathbf {x}}),{\mathbf {x}} \in D\right\} }_{l=1,\ldots ,L}\) results in the following decomposition in finite dimensions:

$$\begin{aligned} \varphi _{U_k}^{(l)}({\mathbf {x}})=\sum _{{k^{\prime }}=1}^L\alpha _{U_{k^{\prime },k}}^{(l)}\psi _{U_{k^{\prime },k}}({\mathbf {x}}), \ \forall {\mathbf {x}} \in D, \ k=1,\ldots ,K; \end{aligned}$$
(5)

where \(\{\alpha _{U_{k^{\prime },k}}^{(l)}\}_{k^{\prime }=1,\ldots ,L}\) are principal component scores (coefficients) and \(\{\psi _{U_{k^{\prime },k}}({\mathbf {x}}), {\mathbf {x}} \in D \}_{k^{\prime }=1,\ldots ,L}\) are principal components factors (basis functions).

In practice, the spatial domain D is represented with a number of grid cells (N). For each category \(c_k (k=1,\ldots ,K)\), PCA is applied to a matrix \(\varvec{\varGamma }_{U_k}(L \times N)\) arranged as a set of L row vectors, each representing a single signed distance realization \({\left\{ \varphi _{U_k}^{(l)}({\mathbf {x}}),{\mathbf {x}} \in D\right\} }\). PCA can be performed in parallel for each matrix \(\varvec{\varGamma }_{U_k} (k=1,\ldots ,K)\). In Eq. (5), the number of principal components is equal to the number of realizations L. Indeed, in spatial problems, the size of the grid (number of grid cells) is usually much higher than the ensemble size used for quantifying spatial uncertainty (\(L<< N\)).

In Eq. (5), the ensemble \({\left\{ \varphi _{U_k}^{(l)}({\mathbf {x}}),{\mathbf {x}} \in D\right\} }_{l=1,\ldots ,L}\) can be seen as a set of images and \({\left\{ \varphi _{U_k}^{(l)}({\mathbf {x}}),{\mathbf {x}} \in D\right\} }\) as an image. Thus, the resulting principal components factors \(\{\psi _{U_{k^{\prime },k}}({\mathbf {x}}), {\mathbf {x}} \in D \}_{k^{\prime }=1,\ldots ,L}\) are images as well. Hence, Eq. (5) provides a decomposition of the images into a set of eigen-images and a set of coefficients. Note that in PCA, the basis functions are fixed, while the coefficients are varying/random. A very useful property of PCA is the bijectivity. It allows the reconstruction of signed distances from coefficients. Moreover, the signed distance transformation is bijective as well. This means that a single set of principal component scores corresponds to a single and unique categorical realization.

The bijective nature of PCA means that an image can be reconstructed back, once all the principal component factors and scores are used. It is important to highlight that the PCA is used here more as an orthogonal decomposition approach than a dimension reduction technique because all the principal component factors are kept. The main reason for using principal component analysis based on the signed distance function instead of the random function modeling the categorical spatial variable of interest is that principal component analysis of categorical data is not very meaningful and in fact inefficient. The reason lies in the fact that a categorical realization contains less information than a signed distance function realization. The distance to a boundary is the additional information, not present in the categorical model.

2.3 Conditioning by the Gibbs sampler

Given the principal component factors \(\{\psi _{U_{k^{\prime },k}}({\mathbf {x}}), {\mathbf {x}} \in D \}_{k^{\prime }=1,\ldots ,L}\) derived from the PCA decomposition of unconditional signed distance realizations as depicted by Eq. (5), the basic idea is to generate new principal component scores such that signed distance realizations match the data. Let

$$\begin{aligned} \varphi _k({\mathbf {x}})=\sum _{{k^{\prime }}=1}^L\alpha _{{k^{\prime }},k}\psi _{U_{k^{\prime },k}}({\mathbf {x}}), \quad \forall {\mathbf {x}} \in D, \quad k=1,\ldots ,K, \end{aligned}$$
(6)

where \(\{\alpha _{{k^{\prime }},k}\}_{k^{\prime }=1,\ldots ,L}\) are random coefficients. It is important to note that all the principal component factors are considered; so there is no truncation.

Principal component (PC) scores of signed distance realizations often show Gaussian type behavior (see Sect. 3.1). For each category \(c_k (k=1,\ldots ,K)\), PC scores vector \(\varvec{\alpha }_{k}={(\alpha _{1,k},\ldots ,\alpha _{L,k})}^T\) is assumed to follow a multivariate normal distribution defined by:

$$\begin{aligned} \varvec{\alpha }_k \sim \exp \left( -\frac{1}{2}{(\varvec{\alpha }_k-\varvec{\mu }_k)}^{T}\varvec{\varSigma }_k^{-1}(\varvec{\alpha }_k-\varvec{\mu }_k)\right) , \ k=1,\ldots ,K; \end{aligned}$$
(7)

where the mean \(\varvec{\mu }_k\) and the covariance matrix \(\varvec{\varSigma }_k\) are computed using unconditional PC scores \(\{\alpha _{U_{k^{\prime },k}}^{(l)}\}_{k^{\prime }=1,\ldots ,L}\) derived from the PCA decomposition of unconditional signed distance realizations given in Eq. (5). Specifically,

$$\begin{aligned} \varvec{\mu }_k={\left[ \frac{1}{L}\sum _{l=1}^L\alpha _{U_{k^{\prime },k}}^{(l)}\right] }_{k^{\prime }=1,\ldots ,L} \quad ; \ \varvec{\varSigma }_k=\frac{1}{L-1}\sum _{l=1}^L(\varvec{\alpha }_{U_k}^{(l)}-\varvec{\mu }_k){(\varvec{\alpha }_{U_k}^{(l)}-\varvec{\mu }_k)}^{T}, \text{ with } \varvec{\alpha }_{U_k}^{(l)}={\left[ \alpha _{U_{k^{\prime },k}}^{(l)}\right] }_{k^{\prime }=1,\ldots ,L}. \end{aligned}$$
(8)

The covariance matrix \(\varvec{\varSigma }_k\) is a diagonal matrix because the PC scores are uncorrelated by construction. Thus, the normality assumption of PC scores can be checked using classical tools in the univariate setting (e.g., normal probability plot, quantile-quantile plot, Kolmogorov-Smirnov test, Shapiro-Wilk test).

As indicated above, hard data informs the sign of the signed distance function associated with a category. Hence, the set of hard data can be translated into as set of inequality constrains using Eq. (6). For example, assume that at the data location \({\mathbf {x}}_1\), the category \(c_2\) is observed (\(C({\mathbf {x}}_1)=c_2\)). This means that the signed distance function associated with the category \(c_2\) should be negative at location \(\mathbf {x_1}\) (\(\varphi _2({\mathbf {x}}_1) \le 0\)), and the signed distance functions associated with other categories should be positive at location \(\mathbf {x_1}\) (\(\varphi _k({\mathbf {x}}_1)\ge 0, \ \forall k\ne 2; k=1,\ldots ,K\)). For each \(\varphi _k (k=1,\ldots ,K)\), the conditioning to all data locations is expressed by the following inequalities:

$$\begin{aligned} {\left\{ \begin{array}{ll} \varphi _k({\mathbf {x}}_1)=\alpha _{1,k}\psi _{U_{1,k}}({\mathbf {x}}_1)+\alpha _{2,1}\psi _{U_{2,k}}({\mathbf {x}}_1)+\ldots +\alpha _{L,k}\psi _{U_{L,1}}({\mathbf {x}}_1) \le 0 \text{ or } \ge 0 \\ \ldots \\ \varphi _k({\mathbf {x}}_n)=\alpha _{1,k}\psi _{U_{1,k}}({\mathbf {x}}_n)+\alpha _{2,k}\psi _{U_{2,k}}({\mathbf {x}}_n)+\ldots +\alpha _{L,k}\psi _{U_{L,k}}({\mathbf {x}}_n) \le 0 \text{ or } \ge 0 \end{array}\right. }. \end{aligned}$$
(9)

In Eq. (9), the n inequalities corresponding to n hard data can be summarized by:

$$\begin{aligned} \varvec{{\tilde{\varPsi }}}_{U_k}\varvec{\alpha }_k \le {\mathbf {0}}, \ k=1,\ldots ,K. \end{aligned}$$
(10)

In Eq. (7), since individual elements of \(\varvec{\alpha }_{k}={(\alpha _{1,k},\ldots ,\alpha _{L,k})}^T\) belong to \(\mathbb {R}\), one can write \(\ -\infty \le \alpha _{k^{\prime },k} \le +\infty , \ k^{\prime }=1,\ldots ,L\). Thus, Eqs. (7) and (10) define a truncated multivariate normal (TMVN) distribution subject to linear inequalities. A good collection of statistical properties of TMVN distributions can be found in Horrace (2005). Thus, the exact conditioning problem is equivalent to the construction of samples from a TMVN distribution subject to linear inequality constraints. Sampling from such distribution proceeds through the Gibbs sampler (Li and Ghosh 2015). Gibbs sampling is a Markov Chain Monte Carlo (MCMC) algorithm where each random variable is iteratively resampled from its conditional distribution given the remaining variables. Gibbs sampling is a good candidate for this task as all full conditional distributions of a truncated multivariate normal distribution are truncated univariate normal (TUVN) distributions. Gibbs sampling requires initial values \(\varvec{\alpha }_k^{(0)}={(\alpha _{1,k}^{(0)},\ldots ,\alpha _{L,k}^{(0)})}^T\) that already satisfy the inequality constraints given in Eq. (10). To do this, a simple linear programming is performed to find an initial solution to the system of inequality constraints (Vanderbei 2013).

Given the Gibbs samples \({\{{\varvec{\alpha }}_k^{(t)}\}}_{t=1,\ldots ,T}\), conditional categorical realizations are given by the following truncation rule:

$$\begin{aligned} C_{C}^{(t)}({\mathbf {x}})={\mathop {{{\,\mathrm{arg\,min}\,}}}\limits _{c_1,\ldots ,c_k}}\left( \varphi _{C_1}^{(t)}({\mathbf {x}}),\ldots ,\varphi _{C_K}^{(t)}({\mathbf {x}})\right) , \ \forall {\mathbf {x}} \in D; \end{aligned}$$
(11)

where \(\varphi _{C_k}^{(t)}({\mathbf {x}})=\sum _{k^{\prime }=1}^L\alpha _{k^{\prime },k}^{(t)}\psi _{U_{k^{\prime },k}}({\mathbf {x}})\) is a conditional signed distance realization associated with category \(c_k (k=1,\ldots ,K)\).

If the categories \(c_1,\ldots ,c_K\) present a certain order (or sequence), the truncation rule defined in Eq. (11) can be modified to account this order as illustrated in Yang et al. (2019). It is important to highlight that the number of conditional categorical simulations T can be greater or less than the number of unconditional categorical simulations L. The Gibbs sampler here can be performed in parallel for each \(\varvec{\alpha }_k (k=1,\ldots ,K)\) as well as for each conditional categorical realization \(t (t=1,\ldots ,T)\). As with other MCMC sampling methods, Gibbs sampler generates a Markov chain of samples, each of which is correlated with nearby samples. As a result, care must be taken to obtain independent samples. It is common to sample T draws and discard the first B, as burn-in, and then retain every sth sample.

Given the set of L unconditional categorical simulations \({\{C_U^{(l)}({\mathbf {x}}), {\mathbf {x}} \in D\}}_{l=1,\ldots ,L}\) and the data \({\{C({\mathbf {x}}_i)\}}_{i=1,\ldots ,n}\), the proposed conditional simulation method performs the following steps:

  1. 1.

    For \(k=1,\ldots ,K\), generate the ensemble of L unconditional signed distance realizations \({\left\{ \varphi _{U_k}^{(l)}({\mathbf {x}}),{\mathbf {x}} \in D\right\} }_{l=1,\ldots ,L}\) using the signed distance transform method;

  2. 2.

    For \(k=1,\ldots ,K\), apply PCA to the matrix \(\varvec{\varGamma }_{U_k}\) arranged as a set of L row vectors, each representing a single unconditional signed distance realization \({\left\{ \varphi _{U_k}^{(l)}({\mathbf {x}}),{\mathbf {x}} \in D\right\} }\); the PCA outcomes are unconditional PC scores \(\{\alpha _{U_{k^{\prime },k}}^{(l)}\}_{k^{\prime }=1,\ldots ,L}\) and PC factors \(\{\psi _{U_{k^{\prime },k}}({\mathbf {x}}), {\mathbf {x}} \in D \}_{k^{\prime }=1,\ldots ,L}\);

  3. 3.

    For \(k=1,\ldots ,K\), generate conditional PC scores \({\{{{(\alpha _{1,k}^{(t)},\ldots ,\alpha _{L,k}^{(t)})}^T}\}}_{t=1,\ldots ,T}\) using the Gibbs sampling approach;

  4. 4.

    For \(k=1,\ldots ,K\), derive conditional signed distance realizations by reconstruction \(\varphi _{C_k}^{(t)}({\mathbf {x}})=\sum _{k^{\prime }=1}^L\alpha _{k^{\prime },k}^{(t)}\psi _{U_{k^{\prime },k}}({\mathbf {x}})\);

  5. 5.

    Apply the truncation rule \(C_{C}^{(t)}({\mathbf {x}})={\mathop {{{\,\mathrm{arg\,min}\,}}}\limits _{c_1,\ldots ,c_k}}\left( \varphi _{C_1}^{(t)}({\mathbf {x}}),\ldots ,\varphi _{C_K}^{(t)}({\mathbf {x}})\right) , \ \forall {\mathbf {x}} \in D\) for obtaining conditional categorical simulations.

2.4 Falsification of unconditional categorical simulations

Most of conditioning approaches, implicitly assume that unconditional simulations and data are consistent. In a Bayesian sense, the prior distribution may not predict the data. Thus, before performing the conditioning of the unconditional categorical simulations to the data, it is important to test if these unconditional categorical simulations are consistent in Bayesian sense with the data. This is achieved by means of a falsification procedure (Scheidt et al. 2018). If unconditional categorical simulations are falsified, the resulting conditional simulations might not reproduce some statistical properties (e.g., mean and variance).

Let \({\mathbf {d}}^{(0)}\) be the vector of observed values at data locations (termed actual dataset) and \({\{{\mathbf {d}}^{(l)}\}}_{l=1,\ldots ,L}\) be the vector of simulated values at data locations (termed simulated dataset). Unconditional categorical simulations are falsified if the actual dataset \({\mathbf {d}}^{(0)}\) is not within the same population as the simulated datasets \({\{{\mathbf {d}}^{(l)}\}}_{l=1,\ldots ,L}\), i.e. \({\mathbf {d}}^{(0)}\) is an outlier. The idea consists in performing a multivariate outlier detection through a hypothesis test. This latter can not be performed directly on datasets \({\{{\mathbf {d}}^{(l)}\}}_{l=0,\ldots ,L}\) because they are categorical information. However, pairwise distances among the datasets (including the actual dataset) can be calculated using a distance measure dedicated to categorical data. Here we choose the Jaccard distance which is one of most popular distance measures for categorical data; however, other distance measures can be used as well. Given the \((L+1)\times (L+1)\) distance matrix between datasets, the Multidimensional scaling (MDS) (Borg and Groenen 2007) can be applied on this latter to map the datasets \({\{{\mathbf {d}}^{(l)}\}}_{l=0,\ldots ,L}\) into an Cartesian space such that distances between points in this space reflect the pairwise distances among the datasets. Thus, each dataset \({\mathbf {d}}^{(l)} (l=0,\ldots ,L)\) (including the actual dataset) is represented by a m-dimensional point \({\mathbf {y}}_l\) (\(m\le (L+1)\)) in the MDS space. To test, if unconditional categorical simulations and actual data are consistent, a statistical procedure based on robust Mahalanobis distance in the MDS space is used.

The robust Mahalanobis distance (RMD) for each dataset (including the actual dataset) is computed as follows:

$$\begin{aligned} RMD({\mathbf {d}}^{(l)})=\sqrt{\left( {\mathbf {y}}_{l}-\mathbf {{\hat{m}}}\right) \mathbf {{\hat{C}}}^{-1} {\left( {\mathbf {y}}_{l}-\mathbf {{\hat{m}}}\right) }^T } \quad l=0,\ldots ,L; \end{aligned}$$
(12)

where \({\mathbf {y}}_l\) are the coordinates of the dataset \({\mathbf {d}}^{(l)}\) in the MDS space; where \(\mathbf {{\hat{m}}}\) and \(\mathbf {{\hat{C}}}\) are the robust estimation of mean and covariance of \({\mathbf {Y}}={[{\mathbf {y}}_{0},\ldots ,{\mathbf {y}}_{L+1}]}^T\) (Hubert et al. 2018).

Assuming that \({\mathbf {y}}_{l}\) is multivariate normally distributed, Mahalanobis distance \({[RMD({\mathbf {d}}^{(l)})]}^2\) follows a Chi-square distribution with m degrees of freedom \(\chi _m^2\). The 97.5 percentile of \(\sqrt{\chi _m^2}\) is used as the cutoff. Thus, if the \(RMD({\mathbf {d}}^{(0)})\) falls outside the tolerance, i.e., \(RMD({\mathbf {d}}^{(0)})>\sqrt{\chi _{m,0.975}^2}\), the \({\mathbf {d}}^{(0)}\) is considered as an outlier, which means unconditional categorical simulations are not consistent with the actual observations, hence are falsified. Although multivariate outlier detection based on the Mahalanobis distance has the advantage of providing robust statistical calculations, it relies on the Gaussian assumption of marginal distribution of data. In the case where this assumption is doubtful, other multivariate outlier detection techniques such as one-class SVM (Schölkopf et al. 2001), Isolation Forest (Liu et al. 2008), local outlier factor (Breunig et al. 2000) can be used.

3 Simulation study

This section first illustrates the method with a simple case, then studies the various elements, components, and parameters.

3.1 Illustration of the method

Consider an object-based simulation, where two sources of information are available: the density of objects (Fig. 3a) and drill-holes with observations of absence (category 1) versus presence (category 2) (Fig. 3b, c). The total amount of hard data is \(n=300\). Constraining object models to dense drill-hole data is challenging, while constraining to a density function is not. In that respect, we first generate an ensemble of 100 object realizations that are constrained to the density, but not to the drill-holes. Constraining to density is done through a rejection method (Lantuejoul 2002). Since there are only two categories, the signed distance function associated with one category is the opposite of the signed distance function associated with another category. So, it sufficient here to consider only one category. We will consider the category 2 (see, Fig. 3b, c).

Fig. 3
figure 3

a intensity map, b reference categorical model, c drill-hole data

Figure 4 shows three unconditional categorical realizations as well as the corresponding unconditional signed distance realizations for category 2. Figure 5 illustrates the consistency between unconditional categorical realizations and data. Figure  5a–c show the actual dataset \({\mathbf {d}}^{(0)}\) and the simulated datasets \({\{{\mathbf {d}}^{(l)}\}}_{l=1,\ldots ,100}\) in the MDS space. The computed RMD for the actual dataset \(RMD({\mathbf {d}}^{(0)})\) and for the simulated datasets \({\{RMD({\mathbf {d}}^{(l)})\}}_{l=1,\ldots ,100}\) are given in Fig. 5d. The computed RMD for the actual dataset falls below the 97.5 percentile threshold which is equal to 6.2. Thus, unconditional categorical realizations are consistent with data.

Fig. 4
figure 4

a, c, e unconditional categorical realizations. b, d, f corresponding unconditional signed distance realizations for category 2

Fig. 5
figure 5

Falsification of unconditional categorical simulations using robust Mahalanobis distance (RMD). ac coordinates of datasets (actual and simulated) in the MDS space. d circle dots represent the calculated RMD for datasets (actual and simulated). The black-squared dot is the RMD for the actual dataset. The black dash line is the 97.5 percentile of the Chi-Squared distributed RMD

To initialize the Gibbs sampling we perform first the linear programming to get an initial solution. Although linear programming finds the optimum of a (linear) objective function subject to inequality constraints, here the objective function is simply a constant, hence it only finds a solution that follows the inequality constraints. Additionally, linear programming finds only one solution. Note that in this case there are 300 inequality constraints. Next, Gibbs sampling is performed with \(T=60{,}000\) iterations. It took approximately 30 minutes on a desktop computer (LINUX environment) with Intel(R) Core(TM) i9-7900X CPU @ 3.30GHz (10 cores / 20 threads), and 120 GB RAM.

Figures 6 and 7 show the trace plot and running average of the first four scores obtained by the Gibbs sampling. One can see how well the chain is mixing. Both the individual samples and the running average of the samples oscillate around a stable value of \(\varvec{\alpha }_k\), which is an indication of convergence of the chain. Typically, in Markov Chain Monte Carlo applications, initial samples are discarded to ensure that the Markov Chain has stabilized to the stationary distribution. This is referred to as burn-in samples. A burn-in period of \(B=10{,}000\) is considered. Another way to check for convergence is to analyze the autocorrelation between samples (Fig. 8). The lag-k autocorrelation is the correlation between every sample and the sample k steps before. As expected, the autocorrelation is high between consecutive samples, and decreases as the separation between samples increases. In this particular example, samples taken \(s=500\) samples apart can be considered as independent. Thus, there are 100 conditional categorical realizations retained. If the autocorrelation remains high for large values of k, this indicates a poor mixing of the chain. In this case, the Gibbs sampler should be performed from different initial solutions for improving mixing.

Fig. 6
figure 6

Trace plot of the first 4 scores in the Gibbs sampler

Fig. 7
figure 7

Running average of the first 4 scores in the Gibbs sampler

Fig. 8
figure 8

Autocorrelation of the first 4 scores in the Gibbs sampler

Figure 9 shows the unconditional and conditional PC scores for the first 4 PCs. We also apply a test for Gaussianity that shows that the unconditional PC scores follow a distribution that is close to Gaussian, see Fig. 10. Figure 11 shows some conditional categorical realizations. All conditional realizations match the data perfectly. The average proportion of objects for conditional categorical realizations is \(26\%\), which is similar to the input proportion of the reference model (\(27\%\)). We do notice some degradation in the object geometries. The conditional mean and variance maps are depicted by Fig. 12.

Fig. 9
figure 9

100 unconditional first 4 PC scores and 100 conditional first 4 PC scores

Fig. 10
figure 10

QQ-plot of the first 4 scores compared to Gaussian distribution

Fig. 11
figure 11

4 out 100 conditional categorical simulations from the proposed conditioning method

Fig. 12
figure 12

a conditional mean and b conditional variance computed from 100 conditional categorical simulations generated using \(L=100\) unconditional categorical simulations

3.2 Monte Carlo evaluation of the method

The proposed conditioning approach relies on an ensemble of unconditional categorical realizations to performing the conditioning on the data. We want study the effect of the number of unconditional categorical realizations versus the number of hard data points on the spatial uncertainty generated with the proposed method. Obviously, enough unconditional categorical realizations are needed to inform the statistical model in the a-priori variation of principal components. An additional condition is brought by the amount of hard data. Hard data are translated into inequality constraints. Too many constraints relative to too few unconditional categorical realizations will lead to too small uncertainty. Our study therefore requires some reference uncertainty. This reference uncertainty is simply a case with a very large amount of unconditional categorical realizations, here 1000. Then we study what happens when the number of unconditional categorical realizations is reduced. A third factor is the nature of the unconditional categorical model. A more spatially correlated unconditional categorical model would need less unconditional categorical realizations.

Our Monte Carlo study therefore varies the number of unconditional categorical models but also varies the spatial model itself. To that extent, we use three alternate object sizes, see Fig. 13, one smaller, one medium and one larger; as well as two different intensity maps, one more constraining. The intent is to study the impact of spatial variability. Of note is the definition of the intrinsic dimensionality of the hard data. The extrinsic dimensionality is 300. However, because of spatial correlation, the intrinsic dimensionality is much less. One way to define this is to look at the variability of the unconditional signed distance realizations at the data locations. In other words, we assign, at each data location the unconditional signed distance realizations and perform the PCA. Then observe dimension H at the 95% variance cut-off. Table 1 shows that the intrinsic dimension H is much less than the number of hard data n and dependent on the unconditional categorical model.

Table 1 Intrinsic dimension H for each case
Fig. 13
figure 13

Spatial model uses tree alternate object sizes and two intensity maps

To establish a measure of distance between the reference uncertainty model and the results, we use the following metric:

$$\begin{aligned} \epsilon _L=\frac{\sum _{i=1}^{N}|Var_i^L-Var_i^{1000}|}{N}, \end{aligned}$$
(13)

which is the average absolute deviation in terms of the conditional ensemble variance. \(N=3000\) refers to the size of entire grid of \(100 \times 30\). The index i in Eq. (13) denotes the grid node. Figures 14 and 15 show how this works for one particular case (less informed trend and large object size). In this case the intrinsic dimension is \(H=16\). We notice how the conditional variance starts to deviate significantly after 75 unconditional realizations, much less than the initial 300. Figure 16 (left) summarizes all the result. For each case, the deviation in variance decreases as the number of unconditional realizations increases. In addition, the deviation in variance is smaller for larger ellipses and for models with a more informed trend. Because of the linearity observed in Fig. 16 (right), we derive a rule of thumb as

$$\begin{aligned} 10\frac{H}{L}=error. \end{aligned}$$
(14)

So to get \(5\%\) error (\(error=5\)), with \(H=50\), we would need \(L=100\) unconditional simulations. It is also important to highlight that increasing the number of unconditional realizations also increases the computational time of the Gibbs sampler. In the case of more than two categories, the rule of thumb is applied to each category. Then, the relevant number of unconditional realizations is taken as the maximum of the relevant number of unconditional realizations associated with each category.

Fig. 14
figure 14

Conditional variance for different number of unconditional categorical simulations corresponding to the case with less informed trend and large object size

Fig. 15
figure 15

Relationship between the number of unconditional categorical simulations and the error in conditional variance for the case with less informed trend and large object size

Fig. 16
figure 16

Summary of the error in conditional variance for all cases (left), error in conditional variance as a function of the number of unconditional categorical realizations L and the intrinsic dimension of the data H

4 Real case study

In this section, the proposed conditional simulation approach is applied to real-world data. These latter are 3D lithological data from a porphyry copper deposit. A challenge in mineral resources assessment lies in estimation of boundaries between lithological, mineralization or alteration contacts. These are the \(K=6\) lithology categories, from the oldest to the youngest: wall rock (IND), Quartz Feldspar Porphyry type 1 (QFP1), Quartz Feldspar Porphyry type 2 (QFP2), intrusive breccia (ABX2), hydrothermal breccia (BRXH), and cover (COV). The physical meaning of the lithology classes is not a concern here. There are \(n=4290\) samples from 116 drill holes. The map of drill hole sample locations of interest is shown in Fig. 17. Indicator variograms and cross-variograms useful for the SIS method are shown in Fig. 18.

4.1 Unconditional categorical simulations

The proposed conditional simulation approach requires unconditional categorical simulations. Here, such unconditional categorical simulations are generated using the following process. First, the hard data are transformed into “pseudo-signed distance” data. At data locations, the true signed distance is not observed; that would require knowing the true boundary. Instead, “pseudo signed distance” values are calculated for each data location as follows (Safa and Soltani-Mohammadi 2018):

$$\begin{aligned} {\tilde{\varphi }}_{k}({\mathbf {x}}_{i})={\left\{ \begin{array}{ll} -\Vert {\mathbf {x}}_{i}-{\mathbf {x}}_{j}\Vert , &{} \text{ if } I_{k}({\mathbf {x}}_{i})=1 \\ +\Vert {\mathbf {x}}_{i}-{\mathbf {x}}_{j}\Vert , &{} \text{ if } I_{k}({\mathbf {x}}_{i})=0 \end{array}\right. }, \quad i=1,\ldots ,n; \quad k=1,\ldots ,K; \end{aligned}$$
(15)

where \({\mathbf {x}}_{j}\) corresponds to the closest data location of different category than at data location \({\mathbf {x}}_{i}\). Euclidean norm is used to measure the distance. The “pseudo signed distance values” at data locations are depicted in Fig. 19.

Fig. 17
figure 17

Representation of lithological data

Fig. 18
figure 18

Indicator variograms and cross-variograms

Fig. 19
figure 19

Pseudo signed distance values at data locations for each lithology category

Secondly, radial basis functions (RBF) interpolation is performed on the “pseudo signed distance” values \({\{{\tilde{\varphi }}_{k}({\mathbf {x}}_{i})\}}_{i=1,\ldots ,n}\) associated with each category. Specifically, one gets (Buhmann 2003):

$$\begin{aligned} {\hat{\varphi }}_k({\mathbf {x}})=\sum _{i=1}^n\omega _k^i h_k(\Vert {\mathbf {x}}-{\mathbf {x}}_i\Vert ), \quad \forall {\mathbf {x}} \in D, \ k=1,\ldots ,K; \end{aligned}$$
(16)

where the basis function \(h_k(\cdot )\) is a radially-symmetric function (e.g., linear, cubic). The unknown coefficients \(\varvec{\omega }_k=(\omega _k^1,\ldots ,\omega _k^n)\) are determined by the requirement that \({\hat{\varphi }}_k(\cdot )\) is an exact interpolator, i.e. \({\hat{\varphi }}_k({\mathbf {x}}_i)= {\tilde{\varphi }}_{k}({\mathbf {x}}_{i}), \ i=1,\ldots ,n.\) The interpolation is performed individually for each category.

Thirdly, an unconditional categorical simulation is obtaining by perturbing the RBF interpolant \(\{{\hat{\varphi }}_k({\mathbf {x}}), {\mathbf {x}} \in D\}\) [Eq. (16)] as follows:

$$\begin{aligned} \phi _k({\mathbf {x}})= {\hat{\varphi }}_k({\mathbf {x}}) + \epsilon _k({\mathbf {x}}), \ \forall {\mathbf {x}} \in D, \ k=1,\ldots ,K; \end{aligned}$$
(17)

and taking \(C({\mathbf {x}})={\mathop {{{\,\mathrm{arg\,min}\,}}}\limits _{c_1,\ldots ,c_k}}\left( \varphi _{1}({\mathbf {x}}),\ldots ,\varphi _{K}({\mathbf {x}})\right) , \ \forall {\mathbf {x}} \in D\). \(\epsilon _k(\cdot )\) is a zero-mean Gaussian random function with an exponential covariance function \(C(\cdot ;\sigma _k^2; \tau _k)\) whose parameters \(\sigma _k^2 \sim {\mathcal {U}}(a_{1,k},a_{2,k})\) and \(\tau _k \sim {\mathcal {U}}(b_{1,k},b_{2,k})\) are uncertain and uniformly distributed (sill and range, see Table 2).

Table 2 Distribution of sill and range parameters of \(\epsilon _k(\cdot )\) defined in Eq. (17)

Initially 1000 unconditional categorical realizations are generated. Then, the relevant number of unconditional categorical realizations to use is based on the rule of thumb given in Sect. 3.2. For each lithology category, the dimensionality of data, i.e., the number of principal components explaining \(95\%\) of the variance is illustrated in Fig. 20. Thus, the relevant number of unconditional realizations to consider is \(L=458\), following the rule of thumb. An example of four unconditional categorical simulations is given in Fig. 21. Figure  22a–c present the actual dataset \({\mathbf {d}}^{(0)}\) and the simulated datasets \({\{{\mathbf {d}}^{(l)}\}}_{l=1,\ldots ,458}\) in the MDS space. Figure 5d shows the calculated RMD for the actual dataset \(RMD({\mathbf {d}}^{(0)})\) and for the simulated datasets \({\{RMD({\mathbf {d}}^{(l)})\}}_{l=1,\ldots ,458}\). As one can notice the computed RMD for the actual dataset falls below the 97.5 percentile threshold which is equal to 9.75. Thus, unconditional categorical realizations are consistent with data (Fig. 22).

Fig. 20
figure 20

Scree plot of PCA on 1000 unconditional signed distance realizations at \(n=4290\) data locations, for each lithology category

Fig. 21
figure 21

Cross-sections of 4 out \(L=458\) unconditional categorical simulations

Fig. 22
figure 22

Falsification of unconditional categorical simulations using robust Mahalanobis distance (RMD). ac coordinates of datasets (actual and simulated) in the MDS space. d circle dots represent the calculated RMD for datasets (actual and simulated). The black-squared dot is the RMD for the actual dataset. The black dash line is the 97.5 percentile of the Chi-Squared distributed RMD

4.2 Conditional categorical simulations

\(T=110{,}000\) Gibbs samples \({\{{\varvec{\alpha }}_k^{(t)}\}}_{t=1,\ldots ,T}\) have been drawn for each lithology category (\(k=1,\ldots ,6\)). The first 10,000 samples of the chain are dropped as burn-in samples, and every 100th sample is accepted. So, there are 1000 conditional simulations. The proposed method took approximately 4 hours on a desktop computer (LINUX environment ) with Intel(R) Core(TM) i9-7900X CPU @ 3.30GHz (10 cores / 20 threads), and 120 GB RAM. PC scores before the conditioning (unconditional PC scores \({\{{\varvec{\alpha }}_k^{(l)}\}}_{l=1,\ldots ,L}\)) and after the conditioning (conditional PC scores \({\{{\varvec{\alpha }}_k^{(t)}\}}_{t=1,\ldots ,T}\)) are presented in Fig. 23. An example of 3 out of 1000 conditional categorical simulations based on the proposed approach and the SIS method is given in Fig. 24. Conditional categorical realizations providing by the proposed conditioning approach depict more regular and continuous contours than SIS conditional categorical realizations. These later show noisy features and contain artifacts that are geologically unrealistic; a well-known characteristic of the SIS method (Deutsch 1998). For instance, lithology category “QFP2” is not expected to appear above the lithology category “COV” (cover). The average proportion over 1000 conditional realizations for each lithology category is given in Table 3. Under the proposed conditional simulation method, the proportions estimated from conditional categorical realizations are close to ones estimated from the data. Whereas, under the SIS method, minor lithology categories tend to be overestimated like “ABX2” and “BRXH”, corresponding to the underestimation of one of major lithology categories such as “IND” and “QFP1”.

Fig. 23
figure 23

\(L=458\) unconditional first PC scores and 500 conditional first PC scores for each lithology category

Fig. 24
figure 24

ac Cross-sections of 3 out 1000 conditional categorical simulations from the proposed conditioning method. df Cross-sections of 3 out 1000 conditional categorical simulations from SIS method

Figures 25 and 26 show respectively, the resulting conditional mean and variance maps for each lithology category under the proposed conditional simulation method and the SIS method. The general appearance of the maps of conditional mean and variance are different although showing some similar patterns. The SIS method has more uncertainty than the proposed approach due to “noisy” realization that SIS is known for (Deutsch 1998).

Fig. 25
figure 25

Proposed method: a, c, e, g, i,k cross-sections of conditional mean for each lithology category computed from 1000 conditional simulations generated using \(L=458\) unconditional simulations. SIS method: b, d, f, h, j, l cross-sections of conditional mean for each lithology category computed from 1000 conditional simulations

Fig. 26
figure 26

Proposed method: a, c, e, g, i, k cross-sections of conditional variance for each lithology category computed from 1000 conditional simulations generated using \(L=458\) unconditional simulations. SIS method: b, d, f, h, j, l cross-sections of conditional variance for each lithology category computed from 1000 conditional simulations

The proposed conditional simulation approach has been also performed for a double number of relevant unconditional categorical simulations, i.e., \(L=916\). Figure 27 show the resulting conditional mean and variance maps for each lithology category computed from 1000 conditional categorical realizations generated using this time \(L=916\) unconditional categorical realizations. The general appearance of the maps of conditional mean and variance based on \(L=916\) unconditional categorical simulations is slightly different to the ones based \(L=458\) unconditional categorical simulations. This observation suggests that there is no need to use more than \(L=458\) unconditional categorical realizations to reproduce a realistic spatial uncertainty.

Fig. 27
figure 27

a, c, e, g, i, k cross-sections of conditional mean for each lithology category computed from 1000 conditional simulations generated using \(L=916\) unconditional simulations. b, d, f, h, j, l conditional variance for each lithology category computed from 1000 conditional simulations generated using \(L=916\) unconditional simulations

Table 3 Average lithology proportions over 1000 conditional simulations

5 Conclusions and future work

In this article, a conditioning method has been proposed for generating conditional categorical simulations from an ensemble of unconditional categorical simulations coming from any simulation approach. The proposed method takes advantage of the implicit functions representation, in combination with principal component analysis and Gibbs sampler to achieve the conditioning to the data. A rule of thumb has been derived in order to select the relevant number of unconditional categorical simulations necessary to capture the spatial uncertainty. A falsification procedure has been proposed to test the consistency between unconditional categorical simulations and the data. Synthetic and real-world case studies have been used to demonstrate the effectiveness of the proposed conditioning method.

Typical characteristics of the proposed conditional simulation approach are the following. It is independent to the method used to construct unconditional categorical simulations; it does not assume that unconditional categorical simulations are independent. The proposed method can easily handle a large number of categories in a consistent manner via the implicit function representation; it can be applied when categories obey an ordered sequence like stratigraphies and lithologies; this order relation can be captured through signed distance functions that are truncated according to a set of rules. The proposed technique can be performed in any dimension (e.g., 1D, 2D and 3D); it can be carried out when the conditioning data are very irregularly or regularly located. The proposed approach provides more realistic categorical realizations than the SIS method as shown in the real case study. It comprises some components that can be performed in parallel according to the number of categories, including the generation of conditional PC scores.

The proposed conditional simulation method relies on the Gibbs sampling of a truncated multivariate Gaussian distribution subject to linear inequality constraints. For each category, the number of linear inequality constraints is equal to the number of data points. The computational time of the proposed method increases with the grid size, the number of unconditional categorical simulations, and the number the data points. When dealing with very large datasets, the proposed method could be time consuming as many conditional simulation methods. To overcome this problem, the number of linear constraints can be reduced due to some redundancy existing in very large datasets. Specifically, very large datasets often exhibit clustered data points. For clustered data points with the same category, only few data points can be considered to derive linear inequality constraints without affecting the conditioning.

Under the proposed conditional simulation technique, the PC scores are assumed to follow the normal distribution. So, prior to apply the proposed approach, the normality assumption of the unconditional PC scores should be checked. In case where the unconditional PC scores deviated significantly from the normal distribution, the resulting conditional categorical simulations might not reproduce some statistical properties. It would be interesting to extend the proposed method to accommodate other distributions other than the Gaussian distribution.