An Application of Bayes Theorem to Geostatistical Mapping
Learning Objectives
- Review Bayes Theorem with an application in geostatistics.
- Motivate Bayes Theorem for secondary data integration.
- Understand a workflow for geostatistical modeling with secondary data (source code available).
Introduction
Uncertainty exists in rock properties at unsampled locations because of geological variability at all scales and relatively sparse sampling. Predicting local uncertainty is straightforward when a multivariate probability distribution of the unsampled value and all data can be constructed. The required conditional distribution is extracted directly from the multivariate distribution. In practice, a slightly different problem exists, that is, the integration of different data sources in the probabilistic prediction. There are times when Bayes Theorem naturally lends itself to assist in the integration of disparate data types. This Lesson reviews Bayes Theorem and shows an application to spatial prediction in presence of secondary data.
Although Bayes Theorem is extensively taught in Statistics, many geoscientists have limited statistics coursework or the courses are taught too early in their degree program for the context of Bayes Theorem to be made clear. The concept of updating an initial or prior understanding to an updated or posterior probability sounds reasonable, but the details warrant further attention. This Lesson aims to provide some clarity to Bayes Theorem in spatial prediction. An application to a simple 2-D mapping problem is shown, with code and data available as a Python notebook.
Bayes Theorem
Following is a classic presentation and interpretation of Bayes Theorem. Consider to be an event we are trying to predict. is some evidence or data that informs on . The conditional probabilities of and are defined as:
These relations are considered axiomatic and the direct arithmetic result of considering multivariate probabilities. They are combined into the familiar form of Bayes Theorem:
This could be rewritten into the following:
- is the updated probability of given also called the posterior.
- is the initial estimate of the probability of also called the prior.
- The combination of is the degree that supports .
- is the rarity of .
- is the relevance of for predicting also called the likelihood.
In many situations is fixed and different ’s are being considered, then the posterior probabilities are written as proportional to the product of the prior and likelihood:
There are many profound interpretations and calculations possible with this theorem. The focus here is the prediction of a regionalized variable at locations within a domain: . Perhaps the best way to understand Bayes Theorem in the context of geostatistics is with an example application.
Example
Consider two rock types. is rock type 1 and not- is rock type 0. Thus, is an indicator random variable at each location in the domain of interest. Consider also a continuous secondary variable over the domain that provides some information on the rock type. Although the variable is measured at all locations it is considered in a probabilistic sense to inform on the variable (probability of ) being predicted.
The goal is to predict that would be expressed as the following given the introduction to Bayes Theorem presented above:
This assumes a decision of stationarity for the initial , knowledge of a deemed stationary marginal distribution of , and the likelihood distribution . The marginal distribution is not strictly required since it does not depend on or not-. The marginal stationary probabilities and are calculated from the available data. A non-parametric estimate of these probabilities could be determined by the proportions of and not- in the data, but clustered data should be considered. Cell declustering (see the lesson on declustering) is considered and the declustered prior probabilities are determined to be and the complement .
Exhaustive data easily permits determination of . As mentioned, it is not needed since the conditional probabilities for and not- could be written as proportional to the prior and likelihood distribution without the marginal of . Although not needed, the marginal distribution of is very well known because it is exhaustively measured and could be used to check future calculations.
Estimation of and from the data may not be particularly reliable because of relatively few data. The histograms below show the distributions based on subsetting the values at locations of and not-. These histograms have few data, so are moderately sensitive to the choice of binning.
Although there are many secondary data the likelihood distributions must be inferred from the secondary data at the 61 locations where we know the primary variable of interest. Drilling or other direct observations of the primary variable is often expensive and there are few data. Fitting a parametric shape to the likelihood distributions is an attractive idea; however, most earth sciences data defy simple parameterization. Kernel density estimation (KDE) is a widely used non-parametric way to estimate the distribution of a random variable with few data. Each data is replaced by a kernel and an estimate of the distribution is the sum of the kernels. Consider a set of data and a kernel that is non-negative and integrates to one. The estimated distribution is written as:
where is a smoothing parameter. There are many references on choosing the smoothing parameter, but Silverman’s rule of thumb is considered here (Silverman, 1986). A Gaussian kernel and rule-of-thumb parameter are given by:
where is the experimental standard deviation of the data and is their interquartile range. Note that the same declustering weights applied to the indicator and not- data would be applied to the data available at the data locations. Applying the kernel density estimator results in the following.
The weighted sum of these two conditional distributions should add up to the marginal of if the weighting is correct and the data are representative. In practice, they are rarely completely consistent. These likelihood distributions should be either restandardized to match the marginal or the posterior probabilities restandardized if the “proportional to” interpretation is considered.
Calculating the posterior probabilities is straightforward with the prior probabilities and the likelihood distributions. The probability of is one minus this probability. The posterior probabilities appear to follow the general trend of the secondary data.
Following is a small geostatistical application of using Bayes theorem to update a prior probability to consider additional evidence or data. The inversion of to the desired is illustrated, that is, the concept of updating a prior by a likelihood.
Implementation Details
This simple example considers a binary rock type indicator and a single secondary variable. In practice, there may be multiple rock types and multiple secondary data. There is no fundamental difference in the approach. A larger number of rock types means fewer observations of the secondary data per rock type. A larger number of secondary data means a higher dimensional likelihood distribution must be inferred. KDE is both more challenging and important for these higher dimensions.
The simple example above considers a categorical variable being predicted. In practice, the variable being predicted could be a continuous rock property. The application of Bayes Theorem is the same, but the likelihood distribution is extracted from a multivariate distribution considering the primary and secondary. In principle, once the full multivariate distribution of all primary and secondary data is established the need for Bayes Theorem is diminished; the desired conditional distributions could be extracted directly. Consideration of local conditioning data complicates matters.
Local Conditioning
The posterior probabilities calculated above are posterior in the context of the secondary data, but there are local conditioning data that should be considered. At locations where local measurements show a rock type of 1 () or 0 (not-), the probabilities must be 1 or 0 depending on the measured value. Note that the map of depends only on and not the local conditioning data. Simply resetting the posterior probability values to 0 or 1 at the data locations is not enough. There is spatial correlation evident in the rock type distribution. The probability of will diminish from 1 gradually away from an conditioning data; the probability of will increase from 0 gradually away from a not- conditioning data. Consideration of this spatial correlation is within the classic paradigm of geostatistics.
The Bayesian framework developed for the consideration of is not easily extended to consider and the local conditioning data at each location. The data configuration and data values around each unsampled location is different; there are no repetitions of data patterns available to calculate likelihood values for precisely the same configuration. There are many ways to address the challenge of simultaneous consideration of secondary data and spatially distributed data of the same type. Any geostatistics book can be reviewed. A simple solution will be demonstrated here.
The approach proposed here consists of three steps (1) calculate the posterior probability given the secondary data as described above, (2) calculate the probability of given the local configuration of data relative to the unsampled location, and (3) combine the probabilities together with some function () making a reasonable assumption about the relationship between and the local data:
The notation refers to the neighborhood of direct measurements relevant to location consisting of some number of data, the data locations and the rock types at those locations. The notation refers to a function to combine the two different conditional probabilities; this comes later.
There are a number of options for the inference of for all locations Domain. The most direct approach would be to find replicates of the events, that is, the configuration of data plus the unsampled location. Then, the conditional probability could be calculated directly by the proportion of times was observed given . This is the Multiple Point Statistics (MPS) technique in geostatistics. MPS requires a large database of patterns called a training image. If a reliable training image is not available, then indicator kriging (IK) could be performed using a covariance model for the indicator random function. This approach will be taken here.
The details of inferring covariance/variogram functions and indicator kriging are found in many geostatistical references. A simplified implementation is provided here. Consider the deemed stationary indicator regionalized variable for all locations Domain with mean value locations Domain. The covariance between two locations is also considered stationary, that is, it only depends on the separation vector between the locations: = = locations Domain. For the sake of simplicity we assume that the covariance is isotropic (depends only on distance and not direction) and can be modeled by an exponential function. Experimental pairs averaged within distance classes and the covariance model are shown. The experimental covariance is strongly negative at the first lag due to the unique data configuration, and is not used when fitting the covariance model.
The probability of at each unsampled location can be calculated from the data with indicator kriging, that is, estimating the event at each unsampled location using a linear estimator with a minimum mean squared error criterion. A constraint that the weights sum to one is considered to avoid dependence on the global mean. The kriging or regression equations are solved in their dual form for efficiency. Define = as the vector of conditioning data (plus a zero), = as the vector of the covariance between each data and the unsampled location (plus a one), and for and = = 1 for and = . The estimated probability of at each unsampled location is given by the global dual ordinary indicator kriging equations (Deutsch & Journel, 1998):
Note that only the last term depends on the unsampled location, thus is solved only once and is referred to as the dual kriging weights. Note also that the estimate is not guaranteed to be within 0 and 1 as it must; these constraints are imposed after estimation. The local probabilities are calculated and shown below:
Now, back to the function to combine the two conditional probabilities (). A common one in geostatistics is called permanence of ratios (Journel, 2002). There are variations on this model in the geostatistics literature and various probabilistic classifiers in machine learning that are similar. The permanence of ratios combination function for two data sources is given by:
where is , is , is and this is applied for all locations Domain:
The result considers the secondary data and direct measurements of . Note that there are more areas where the probabilities are closer to 0 and 1: areas identified by the secondary data and areas identified by the direct measurements. The uncertainty at unsampled locations has been reduced. The only way to reduce the uncertainty further is to consider additional data.
There are alternatives in geostatistics for data integration including cokriging, but this presents a reasonably straightforward implementation for geostatistical mapping. The uncertainty quantified above is for each location one at a time, which is suitable for many purposes. The simultaneous uncertainty of multiple locations at a time is required for some applications and this uncertainty would have to be sampled by simulation, for example, a sequential simulation procedure.
Summary
The notion of Bayesian inversion is important for geostatisticians. The posterior conditional probability of our variable of interest given secondary data is proportional to the prior global probability of the variable of interest and the likelihood probability of the secondary data given the variable of interest. In the presence of relatively few direct measurements it is relatively straightforward to infer the likelihood distributions, then apply Bayesian inversion. The notion of conditioning is important for statisticians. The local configuration of data around each unsampled location is unique and defies a straightforward application of Bayes Theorem. Indicator kriging is one approach to estimate the conditional probability of an event at an unsampled location given surrounding conditioning data. Combining two estimates of conditional probability can be made with permanence of ratios. There are other ways to approach this problem, but the variety of principles touched on in this Lesson are important and widely used throughout geostatistics.
References
Cite this lesson as:
Deutsch, C. V., & Deutsch, J. (2018). An Application of Bayes Theorem to Geostatistical Mapping. In J. L. Deutsch (Ed.), Geostatistics Lessons. Retrieved from https://geostatisticslessons.com/lessons/bayesmapping