Using The Gibbs Sampler For Conditional Simulation of Gaussian-Based Random Fields
Using The Gibbs Sampler For Conditional Simulation of Gaussian-Based Random Fields
Abstract
This article presents models of random fields with continuous univariate distributions that are defined by simple
operations on stationary or intrinsic Gaussian fields. Realizations of these models can be conditioned to a set of data by
using iterative algorithms based on the Gibbs sampler, while parameter inference relies on the fitting of the sample
univariate and bivariate distributions. The proposed models are suited to the description of regionalized variables with a
spatial clustering of high or low values, patterns of connectivity and curvilinearity, or an asymmetry in the spatial
correlation of indicator variables with respect to the median threshold. The simulation procedure is illustrated by a case
study in environmental science dealing with nickel concentrations in the topsoil of a polluted site.
r 2006 Elsevier Ltd. All rights reserved.
Keywords: Geostatistics; Stochastic simulation; Gaussian random field; Indicator variogram; Bivariate distributions
0098-3004/$ - see front matter r 2006 Elsevier Ltd. All rights reserved.
doi:10.1016/j.cageo.2006.08.003
ARTICLE IN PRESS
X. Emery / Computers & Geosciences 33 (2007) 522–537 523
Other random field models are needed when these 1993), which consists in composing two random
properties are not suitable for the data at hand, e.g. fields: a directing function that introduces a random
Boolean, object-based or plurigaussian models perturbation of coordinates (in the present case, the
(Lantuéjoul, 1997, 2002; Chilès and Delfiner, 1999; identity plus the vectorial field T), and a coding
Emery, 2005b). So far, most of such models process (X). Also note that Eq. (1) is quite general,
correspond to random fields with discrete univariate as the multivariate Gaussian model is met when the
distributions. This work aims at presenting new variograms in CT have infinitely small sills.
models with continuous univariate distributions and
at proposing algorithms for their conditional 2.1.2. Characterization of univariate and bivariate
simulation. The principle will be to construct distributions
complex random fields via operations on simpler Given the realization of the perturbation field, say
(Gaussian) fields, for which prior and posterior T ¼ t, Y has the same univariate distribution as X
distributions are known. The next section gives (standard Gaussian) and its multivariate distribu-
examples of random fields with Gaussian univariate tions are Gaussian, as any weighted average of Y-
distributions. Models with skewed distributions will variables is also a weighted average of X-variables,
be presented in the subsequent section. hence is normally distributed. In particular, any
pair (Y(x+h),Y(x)) has a standard bivariate
2. Random fields with Gaussian univariate Gaussian distribution with conditional correlation
distributions coefficient
2.1. First model: Gaussian field with random corr Y ðx þ hÞ; Y ðxÞjT ¼ t
coordinate perturbation ¼ cov X ðx þ h þ tðx þ hÞÞ; X ðx þ tðxÞÞ
¼ rX ðh þ tðx þ hÞ tðxÞÞ. ð2Þ
2.1.1. Presentation of the model
A first idea to construct a random field with When restoring the randomness of T, it is seen that
Gaussian univariate distributions is to rearrange the the prior univariate distribution of Y is standard
spatial distribution of the values of a multivariate Gaussian and its prior bivariate distributions
Gaussian random field in a random fashion. For are mixtures of standard bivariate Gaussian dis-
instance, let us consider the following model in tributions with randomized correlation coeffici-
Rd ðd 2 Nn Þ: ents. Such bivariate distributions are known as
‘Hermitian’ distributions in the geostatistical litera-
8x 2 Rd ; Y ðxÞ ¼ X ðx þ T ðxÞÞ, (1)
ture (see Appendix B). Because T(x+h)T(x) is a
where T ¼ (T1, y, Td) is a vectorial Gaussian Gaussian vector with zero mean and variance-
random field with d components defined in Rd and covariance matrix 2CT(h), the prior distribution
X is an independent standard Gaussian random of (Y(x+h),Y(x)) is characterized by the random
field with stationary correlogram rX in Rd . The variable
vectorial field T appears as a random perturbation pffiffiffiffiffiffiffiffiffiffiffiffiffiffi
of coordinates that alters the spatial distribution of RðhÞ ¼ rX h þ 2CT ðhÞU (3)
the subjacent Gaussian field X. In the following,
assume that T1, y, Td have jointly stationary in which U is a d-dimensional random vector with
increments (intrinsic stationarity) and let CT(h) independent standard Gaussian components. The
be the d d matrix of their simple and cross- square root of 2CT(h) is obtained by diagonalizing
variograms for lag vector h 2 Rd . this matrix in an orthonormal basis and square
When mapping the realizations of Y, a large rooting the entries of the diagonal matrix. As R(h)
variety of textures can be obtained, depending on does not depend on x, the prior bivariate distribu-
the choice of CT and rX. Four examples are shown tions of Y are second-order stationary (invariant
in Fig. 1, in which one observes patterns of spatial under translation). The prior correlogram of Y for
clustering, connectivity, curvilinearity and local lag vector h is the expected value of R(h), i.e.
anisotropies that do not occur with realizations of
corr Y ðx þ hÞ; Y ðxÞ
stationary Gaussian random fields. Z pffiffiffiffiffiffiffiffiffiffiffiffiffiffi
The model presented in Eq. (1) is a particular case ¼ rX h þ 2CT ðhÞu gU ðuÞ du, ð4Þ
of the so-called substitution model (Lantuéjoul, Rd
ARTICLE IN PRESS
524 X. Emery / Computers & Geosciences 33 (2007) 522–537
Fig. 1. Four realizations of a perturbed Gaussian random field with isotropic exponential correlogram. Components of perturbation
field are assumed independent and identically distributed. Each realization corresponds to a specific perturbation variogram
model: (A) exponential, (B) cubic, (C) nested exponential plus cubic, and (D) cardinal sine.
are independent, the last two constraints can be generating two other realizations with the proposed
omitted and it remains to simulate X(xI0 +tI0 ) algorithm (Figs. 2C and D). The Gibbs sampler has
conditionally to X(xA+tA) ¼ yA. been stopped after 100 000 iterations, which corre-
sponds to an average of 500 update attempts (about
Steps (2) and (3) are straightforward, since they 340 successful updates) for each datum.
consist of the conditional simulation of second-
order stationary or intrinsic Gaussian random 2.2. Second model: random mixture of Gaussian
fields. Regarding step (1), an iterative algorithm fields
based on the Gibbs sampler is proposed hereafter.
The Gibbs sampler (Geman and Geman, 1984; 2.2.1. Model definition
Casella and George, 1992) is a particular case of Consider a weighted average of K independent
Markov Chain Monte Carlo method and allows stationary standard Gaussian fields {Y1, y, YK}
simulating random vectors with complicated dis- with the same covariance function C(h)
tributions; the key idea is to replace the sampling of
X
K
a joint probability distribution by that (simpler) of 8x 2 Rd ; Y ðxÞ ¼ wk Y k ðxÞ, (6)
univariate conditional distributions (see Appendix k¼1
C). In the present case, the procedure consists of the
where w ¼ (w1, y, wK) is a vector on the unit
following steps:
hypersphere of RK . Based on this model, Hu
(2000) proposed an iterative procedure (named
(a) Initialize T(xA) ¼ tA. For instance, t1,ytn can
gradual deformation) to calibrate the realizations
be independent Gaussian vectors with variance-
of Y to nonlinear data. At each iteration, K1
covariance matrix equal to the sill matrix
independent realizations, say {Y1, y, YK1}, are
CT(N).
combined with the optimized realization YK ob-
(b) Select an index a at random (uniformly) in A.
tained at the previous iteration.
Define B ¼ A{a}.
Let us generalize the model defined in Eq. (6) by
(c) Simulate T(xa) conditionally to T(xB) ¼ tB. The
putting
components of T(xa) have Gaussian distribu-
XK
tions; their first- and second-order moments are 8x 2 Rd ; Y ðxÞ ¼ W k ðxÞY k ðxÞ (7)
their cokriging estimates and variances (simple k¼1
cokriging if T is second-order stationary,
ordinary cokriging if T is intrinsic) (Emery, with
2004). Let ta0 be the new simulated value of Y
K 1
W 1 ðxÞ ¼ cos½T k ðxÞ,
T(xa) and ta the former value. k¼1
(d) Calculate the conditional densities associated
Y
K1
with the former and new states W k ðxÞ ¼ sin½T k1 ðxÞ cos½T ‘ ðxÞ ðk ¼ 2; :::K 1Þ,
‘¼k
p ¼ gY yA jta ; tB and p0 ¼ gY yA jt0a ; t0B . (5)
W K ðxÞ ¼ sin½T K1 ðxÞ; ð8Þ
As mentioned earlier, conditionally to T ¼ t,
Y is a standard Gaussian random field. Hence where T ¼ (T1, y, TK1) is a stationary vectorial
gY is a multivariate Gaussian probability density random field independent of Y1yYK, and
function; the entries of the covariance matrix are W ¼ (W1, y, WK) is a vectorial random field on
given by the correlation function in Eq. (2). the unit hypersphere of RK .
(e) Draw a uniform value u on [0,1].
(f) Substitute ta0 for ta if upp0 =p, in accordance 2.2.2. Univariate and bivariate distributions
with Metropolis algorithm (Metropolis et al., It is easy to show that the univariate distribution
1953). of Y is standard Gaussian. Let us now examine its
(g) Return to step (b) and loop many times. bivariate distributions. Given T ¼ t, the distribution
of a pair (Y(x),Y(x0 )) is standard bivariate Gaussian
As an illustration, a non-conditional realization with correlation coefficient
has been drawn on a 400 400 grid (Fig. 2A) and
Fig. 2. Coordinate perturbation model. (A) non-conditional realization, (B) conditioning data, (C) and (D) two conditioned realizations
(data locations are superimposed).
where w(x0 ) and w(x) are the realizations of W(x0 ) versa. Another example is obtained when T1 is a
and W(x), respectively, while /,S is the inner random field with stationary Gaussian increments
product in RK . Accordingly, the prior distribution (Fig. 3B).
of (Y(x0 ),Y(x)) is Hermitian (mixture of standard
bivariate Gaussian distributions) and is character- 2.2.3. Conditional simulation
ized by the random variable Let us come back to the problem of simulating Y
at locations xI0 given the values yA monitored at
Rðx0 ; xÞ ¼ Cðx0 xÞhWðx0 Þ; WðxÞi. (10)
locations xA (same notations as in Section 2.1.3).
Since T is stationary, the distribution of /W(x0 ), This problem is solved in five steps:
W(x)S only depends on x0 x, hence the bivariate
distributions of Y are stationary, i.e. shift-invariant. (1) Simulate T(xA) conditionally to Y(xA) ¼ yA and
This property holds even if T1 has stationary obtain a set of vectors tA. A Gibbs sampler
increments (intrinsic stationarity), hence the statio- procedure similar to that described in Section
narity assumption on the first component of T can 2.1.3 can be designed. At each iteration, one
be released. selects a uniform index a in A and attempts to
For instance, if K ¼ 2, one has (Matheron, 1982) update T(xa) by using Metropolis algorithm.
Note that the explicit values of Y1(xA), y, YK
Rðx0 ; xÞ ¼ Cðx0 xÞ cos½T 1 ðx0 Þ T 1 ðxÞ. (11)
(xA) need not be simulated to achieve this step.
If the outcomes of T1 are 0 or p/2, the realizations (2) Simulate T(xI0 ) conditionally to T(xA) ¼ tA and
of Y consist of pieces of Y1 and Y2 fitted together as Y(xA) ¼ yA. The last constraint can actually be
in a jigsaw puzzle (Fig. 3A); sharp transitions may dropped, as {Y(xA)|T(xA) ¼ tA} only depends
be observed when T1 moves from 0 to p/2 or vice on Y1,y, YK [Eqs. (7) and (8)], not on T.
ARTICLE IN PRESS
X. Emery / Computers & Geosciences 33 (2007) 522–537 527
Fig. 3. Two realizations of a random mixture of two Gaussian fields. Random field T1 is (A) p/2 times a truncated Gaussian field, and (B)
a random field with linear variogram and stationary Gaussian increments.
Y
K
8y 2 R; ProbðY ðxÞoyÞ ¼ ProbðT k ðxÞoyÞ,
k¼1
8y; y0 2 R; ProbðY ðx þ hÞoy; Y ðxÞoy0 Þ
Y
K
¼ ProbðT k ðx þ hÞoy; T k ðxÞoy0 Þ. ð14Þ
k¼1
(b) Set ta0 ¼ ta2a as a candidate value to replace ta. chromium, copper, nickel, lead and zinc) have been
(c) Calculate the conditional densities associated measured. The reader is referred to Atteia et al.
with the former and new states (1994) for a description of the data and sampling
protocol.
p ¼ gT ðta jtB Þ and p0 ¼ gT ðt0a jtB Þ. (21)
3.4. Case study: Swiss Jura data set Number of data 359
Minimum (mg/kg) 1.98
Maximum (mg/kg) 53.20
An application of the previous procedure to the Mean (mg/kg) 20.02
modeling of a pollutant concentration is now Standard deviation (mg/kg) 8.09
considered. The data set under study consists of First quintile (mg/kg) 12.48
359 soil samples that have been collected by the Second quintile (mg/kg) 18.68
Swiss Federal Institute of Technology in the Swiss Third quintile (mg/kg) 22.59
Fourth quintile (mg/kg) 26.40
Jura over a region of 1450 ha. In each sample, the
concentrations of heavy metals (cadmium, cobalt, Jura pollution data set.
ARTICLE IN PRESS
X. Emery / Computers & Geosciences 33 (2007) 522–537 531
Fig. 7. Sample (circles) and modeled (solid lines) direct variograms of quintile indicators (Jura pollution data set). Only omni-directional
calculations are considered.
Fig. 8. Sample (circles) and modeled (solid lines) cross variograms of quintile indicators (Jura pollution data set).
ARTICLE IN PRESS
X. Emery / Computers & Geosciences 33 (2007) 522–537 533
variograms is found when the model is defined by (3) Calculate the sample variograms of the values
the minimum of two independent Gaussian fields T1 obtained in the previous step and check whether
and T2 with the parameters given in Table 2. These they match (on average over the realizations) the
parameters are validated by examining the cross theoretical models defined in Table 2 or not.
variograms between quintile indicators: the fittings
remain quite satisfactory (Fig. 8), which proves that
the modeled bivariate distributions are suited to Fig. 9 presents the average sample variograms of
that of the data. Note that no check is done about T1 and T2 obtained by using 10 000, 30 000 and
the distributions of higher order, as the small 100 000 iterations in the implementation of the
number of data prevents one to calculate reliable Gibbs sampler. In the last case one observes that
sample statistics on these distributions. The data the sample variograms almost perfectly match the
values can now be transformed into a new set of theoretical models, indicating that convergence is
data that fit the univariate distribution of the model practically reached. Based on these results, it is
and that will be used as conditioning information to decided to achieve simulations of nickel concentra-
simulate nickel concentrations over the area of tions by stopping the Gibbs sampler after 100 000
interest. iterations, which corresponds to an average of 278
The implementation of the proposed simulation updates for each datum.
procedure (Section 3.1.2) raises the question of how As an illustration, two conditional realizations
many iterations are needed to ensure the conver- are displayed on the left-hand side of Fig. 10. The
gence of the Gibbs sampler. Since theoretical results right-hand side of this figure corresponds to two
in this respect are hard to derive, convergence will realizations obtained in the scope of the multi-
be assessed from an empirical point of view. The variate Gaussian model, in which nickel concentra-
proposed exercise consists of the following steps: tions are represented by an increasing transform of
a stationary Gaussian random field. One observes
that multivariate Gaussian realizations display no
(1) Construct a set of non-conditional realizations specific structural pattern, due to their maximum
of the two Gaussian fields T1 and T2 at the data entropy property. In particular, high and low nickel
locations, and derive non-conditional realiza- concentrations are scattered in space, giving an
tions of Y ¼ min(T1,T2) at these locations. impression of ‘diffusiveness’. In contrast, the
(2) For each realization of Y, simulate T1 and T2 at proposed model (Fig. 10, left) leads to a spatial
the data locations by using step (1) of the clustering of small nickel concentrations that reflects
algorithm described in Section 3.1.2 with a pre- the better spatial correlation of the lower quintile
specified number of iterations. indicator. These differences in the spatial distribu-
Fig. 9. Theoretical and sample variograms for Gaussian data obtained with Gibbs sampler. Sample variograms have been averaged over
50 realizations.
ARTICLE IN PRESS
534 X. Emery / Computers & Geosciences 33 (2007) 522–537
Fig. 10. Conditional realizations of nickel concentrations (Jura pollution data set). Left-hand side: model defined by minimum of two
Gaussian random fields. Right-hand side: multivariate Gaussian model.
tion may have an impact in the response to transfer ditioned to existing data. The combination of
functions, e.g. in the distribution of the upscaled models and of their parameters allow one to
nickel concentrations over remediation units. reproduce varied structural features, in particular
a spatial clustering of high or low values, patterns of
4. Conclusions connectivity and curvilinearity, local anisotropies,
or an asymmetry in the correlation of indicator
This paper presented four models of random variables with respect to the median threshold. The
fields with continuous univariate distributions and list of proposed models is far from being exhaustive
proposed algorithms to construct realizations con- and many variants could be designed.
ARTICLE IN PRESS
X. Emery / Computers & Geosciences 33 (2007) 522–537 535
The choice of a model rather than another may be The indicator cross variograms are derived as follows
guided by the analysis of indicator variograms. (Wackernagel, 2003, p. 147):
Hermitian models should be used if the indicator
8x; x þ h 2 Rd ; gðy; y0 ; hÞ ¼ Cðy; y0 ; 0Þ
variogram at percentile p is similar to that at
percentile 1p. Otherwise models with skewed 1
½Cðy; y0 ; hÞ þ Cðy0 ; y; hÞ. ðA3Þ
distributions should be preferred. Mapping the 2
values of a few non-conditional realizations can
also help practitioners to decide or to reject a Appendix B. Bivariate Hermitian distributions
particular model, depending on their background
understanding of the spatial distribution of the A bivariate distribution is said to be ‘Hermitian’
attribute under study. if its probability density function has a representa-
The Gibbs sampler proves to be a useful tool to tion of the form (Wackernagel, 2003, p. 254)
deal with conditioning information in simulation
algorithms. As for any iterative procedure, practi- 8ðy; y0 Þ 2 R2 ; gðy; y0 Þ ¼ gðyÞgðy0 Þ
tioners may wonder about its rate of convergence. Xþ1
This issue has been studied by several authors T p H p ðyÞH p ðy0 Þ with T p ¼ EðRp Þ,
p¼0
(Chan, 1993; Roberts and Sahu, 1997; Galli and
Gao, 2001), but theoretical results are often limited ðB1Þ
or unpractical. A simple alternative is to assess the where g is the standard Gaussian probability density
rate of convergence empirically, by comparing the function, R a random variable in [1,1] and
sample variograms of the Gaussian data obtained fH p ; p 2 Ng the set of normalized Hermite poly-
with the Gibbs sampler over a few realizations with nomials
the corresponding variogram models, in order to
decide for a suitable number of iterations. 1 dp gðyÞ
8p 2 N; 8y 2 R; H p ðyÞ ¼ pffiffiffiffi . (B2)
p!gðyÞ dyp
Acknowledgements The standard bivariate Gaussian distribution with
correlation coefficient r is found when the random
This research was funded by the National Fund variable R is almost surely equal to r. In such a
for Science and Technology of Chile (FONDECYT) case, Eq. (B1) amounts to Mehler’s expansion of the
and is part of project number 1061103. The author bivariate Gaussian density (Barrett and Lampard,
acknowledges the two reviewers for constructive 1955). In the general case, the bivariate Hermitian
comments that helped to improve the manuscript. distribution is a mixture of standard bivariate
Gaussian distributions with random correlation
Appendix A. Tools for inference and validation coefficients and is fully determined by the prob-
ability distribution of R.
In general, the parameters of a random field model Let now Y ¼ fY ðxÞ; x 2 Rd g be a stationary
are inferred from the sample univariate and bivariate random field with bivariate Hermitian distributions,
distributions. Let Y be the random field of interest and R(h) the random variable characterizing the dis-
define the indicator variable associated with threshold y tribution of (Y(x),Y(x+h)) and Tp(h) the pth
moment of R(h). For any pair (y,y0 ) of real numbers,
1 if Y oy;
1Y oy ¼ (A1) the cross-variogram between 1Y(x+h)oy and 1Y(x)oy0
0 otherwise: is (Chilès and Delfiner, 1999, p. 399)
The bivariate distributions of Y are characterized by gðy; y0 ; hÞ ¼ Gðminðy; y0 ÞÞ GðyÞGðy0 Þ gðyÞgðy0 Þ
the indicator simple and cross non-centered covariance X H p1 ðyÞH p1 ðy0 Þ
functions. Under an assumption of stationarity, these T p ðhÞ, ðB3Þ
functions do not depend on the current locations, but pX1
p
only on the separation vector where G is the standard Gaussian cumulative
2
8x; x þ h 2 Rd ; Cðy; y0 ; hÞ distribution function. Since Hp1 is an even
polynomial, the indicator simple variogram at
¼ Ef1Y ðxþhÞoy 1Y ðxÞoy0 g
threshold y is the same as that at threshold
¼ ProbfY ðx þ hÞoy; Y ðxÞoy0 g. ðA2Þ y: g(y; y; h) ¼ g(–y; –y; h).
ARTICLE IN PRESS
536 X. Emery / Computers & Geosciences 33 (2007) 522–537
Appendix C. Classical and metropolized Gibbs the chain, which in turn implies the invariance
samplers property (Tierney, 1994).
Lantuéjoul, C., 1997. Conditional simulation of object-based Metropolis, N., Rosenbluth, A.W., Teller, A.H., Teller, E., 1953.
models. In: Jeulin, D. (Ed.), Advances in Theory and Equation of state calculation by fast computing machines.
Applications of Random Sets. World Scientific Publishing Journal of Chemical Physics 21 (6), 1087–1092.
Company, Singapore, pp. 271–288. Roberts, G.O., Sahu, S.K., 1997. Updating scheme, correlation
Lantuéjoul, C., 2002. Geostatistical Simulation, Models and structure, blocking and parametrization for the Gibbs sampler.
Algorithms. Springer, Berlin, 256pp. Journal of the Royal Statistical Society B 59 (2), 291–317.
Matheron, G., 1982. La déstructuration des hautes teneurs et le Tierney, L., 1994. Markov chains for exploring posterior
krigeage des indicatrices. Internal Report N-761, Centre de distributions. The Annals of Statistics 22 (4), 1701–1762.
Géostatistique, Ecole des Mines de Paris, Fontainebleau, Wackernagel, H., 2003. Multivariate Geostatistics, An Introduc-
France, 33pp. tion with Applications, third ed. Springer, Berlin, 387pp.