Combination of Multivariate Gaussian Distributions through Error Ellipses
Oktay Erten, University of Alberta
Clayton V. Deutsch, University of Alberta
Learning Objectives
Understand how to draw an error ellipse (or density contour) of a bivariate Gaussian distribution considering a given confidence level.
Derive the equations for combining multivariate Gaussian distributions through error ellipses.
Appreciate the error ellipses method using a simulated bivariate Gaussian dataset.
Introduction
The combination of probability distributions is a common challenge encountered in geology, engineering, and statistics. The distributions come from different data sources or sensors. The distributions could be univariate, bivariate or multivariate. The techniques to combine the distributions include (1) formulating and parameterizing a high dimensional distribution from which conditional distributions can be computed - called cokriging in geostatistics (C. V. Deutsch & Journel, 1998; Doyen, 1988) (2) considering a known prior distribution and making a neutral assumption about the redundancy in the information content - called collocated cokriging or Bayesian Updating in geostatistics (Doyen, Boer, & Pillet, 1996; Xu, Tran, Srivastava, & Journel, 1992), and (3) considering no prior distribution and conditional independence in the likelihood distributions - called Error Ellipses in the literature (Blachman, 1989). This Lesson aims to develop the latter technique.
There is a reasonably informed prior distribution in most spatial prediction problems; it comes from a careful choice of a stationary population and declustering of the available data. The error ellipses method would not be appropriate. There are situations, however, where there is no prior and the data sources are very different; the error ellipses technique is useful when a combined estimate of the probability distribution is required. For example, the horizontal variogram calculated from a few wells is highly uncertain, whereas the horizontal variogram calculated from dense seismic information would be more structured but noisier. The estimation of the horizontal variogram from the wells can be improved by combining the distributions of the squared differences from wells and seismic information for each lag (Rezvandehy, 2016). In this Lesson, the construction of the confidence ellipse of a bivariate Gaussian distribution is first reviewed. The error ellipse method and derivation of its equations are explained, and the method is demonstrated using a simulated bivariate Gaussian dataset.
Multivariate Gaussian Distribution
Probability Density Function
Consider a p×1 random vector X=[X1,...,Xp]T that has a multivariate Gaussian distribution X∼Np(μ,Σ). Its probability density function is given as follows:
f(X∣μ,Σ)=(2π)p/2∣Σ∣1/21exp{−21(X−μ)TΣ−1(X−μ)}
where p is the dimension of the vector; μ is the p×1 vector of means μ=[μ1,...,μp]T, and Σ is the p×p positive definite covariance matrix Σ of X:
If a random vector X is multivariate Gaussian, each random variable of X is also Gaussian. If ρ=0, that is, Σ is a diagonal matrix (all off-diagonal elements are zero), the multivariate Gaussian distribution factorizes into the product of p univariate Gaussian densities (Johnson & Wichern, 1988).
Density Contours of a Bivariate Gaussian Distribution
The plot of the density (or probability) contours of a bivariate Gaussian distribution represents a three-dimensional surface. The constant probability contours, however, can be plotted on a two-dimensional format by considering the same height on the z-axis (or the constant height of the surface). Consider that a random vector X=[X1,X2] has a bivariate (p=2) Gaussian distribution. The scalar quantity of the square of the distance (X−μ)TΣ−1(X−μ)=K is referred to as the squared Mahalanobis distance of the vector X to the mean vector μ. The surface on which the random variable K is constant is an ellipse (or a p-dimensional ellipsoid in the multivariate case) centered at μ=[μ1,μ2]. This ellipse (or a probability contour) defines the region of a minimum area (or volume in multivariate case) containing a given probability under the Gaussian assumption. Figure 1 illustrates confidence (error) ellipses with one-, two-, and three-sigma axis lengths (enclosing approximately 39.3%, 86.5%, and 98.9% in two dimensions), considering the cases where the random variables are (1) positively correlated ρ>0, (2) negatively correlated ρ<0, and (3) independent ρ=0.
Figure 1: Error ellipses with one-, two-, and three-sigma axis lengths
This figure shows how the ranges (or lengths) and directions of the axes of the ellipses change depending on the selected confidence level and the covariance matrix of the random vector X. The confidence ellipses constructed based on the given confidence levels can be used to check the bivariate Gaussianity of a given distribution (J. L. Deutsch & Deutsch, 2011).
Step 1: Selecting a probability level for the error ellipse
The quadratic form defining the scalar random variable K has a chi-square distribution with two degrees of freedom:
P{K≤χ22(α)}=P{(X−μ)TΣ−1(X−μ)≤χ22(α)}=1−α
where χ22(α) is the upper-tail critical value with exceedance probability α of the χ2-distribution with two degrees of freedom. 1−α is the probability (or a confidence level) that the value of the random vector X will be inside the ellipse. For example, consider that the given probability is α=0.05, that is, χ22(0.05)=5.99, then the 95% confidence ellipse is defined by:
P{K≤χ22(0.05)}=P{(X−μ)TΣ−1(X−μ)≤5.99}=0.95
Step 2: Calculating the eigenvalues of the covariance matrix
The positive definite (∣Σ∣=0 and Σ−1 exists) covariance matrix Σ of the random vector X=[X1,X2] is as follows:
Σ=[σ11σ21σ12σ22]
The eigenvalues λ=[λ1,λ2] of Σ are calculated by:
where σ11 and σ22 are the variances of the random variables X1 and X2, and ρ is the linear correlation coefficient.
Step 3: Calculating the lengths of the ellipse axes
The lengths of the ellipse axes are a function of the critical value χ22(α), the eigenvalues λ=[λ1,λ2] and the linear correlation coefficient ρ. For example, 95% confidence ellipse is defined by:
[X1−μ1X2−μ2]Σ−1[X1−μ1X2−μ2]≤χ22(0.05)
As Σ denotes a symmetric matrix, its eigenvectors can be chosen to be orthonormal. Therefore, Σ can be written as follows:
Σ=TDT−1
where T=[υ1∣υ2] are the eigenvectors of Σ and D is the diagonal matrix of the eigenvalues λ=[λ1,λ2]:
D=[λ100λ2] replacing Σ−1 by TD−1T−1, the square of the difference can be written as: [X1−μ1X2−μ2]TD−1T−1[X1−μ1X2−μ2]≤χ22(0.05)
Denoting
[ω1ω2]=T−1[X1−μ1X2−μ2]
As TT=T−1, the square of difference can be expressed as:
[ω1ω2][λ100λ2]−1[ω1ω2]≤χ22(0.05)
If the above equation is further evaluated, the resulting equation is the equation of an ellipse aligned with the axis ω1 and ω2 in the new coordinate system.
χ22(0.05)λ1ω12+χ22(0.05)λ2ω22≤1
The axes of the ellipse are defined by ω1 axis with a length 2χ22(0.05)λ1 and ω2 axis with a length 2χ22(0.05)λ2.
When ρ=0, the eigenvalues are σ11 and σ22. Choosing the eigenvectors in coordinate-axis order, the T matrix becomes an identity matrix. The final equation of an ellipse is then defined by:
It is clear from the equation given above that the axes of the ellipse are parallel to the coordinate axes. The lengths of the axes of the ellipse are then defined as 2σ11χ22(0.05) and 2σ22χ22(0.05). Figure 2 displays 95% confidence ellipses drawn when the variables are positively correlated and when they are independent.
Figure 2: 95% confidence ellipses and their semi-diameters when ρ>0 and ρ=0
It is clearly seen from Figure 2 that when ρ>0, the axes of the ellipse are aligned with the rotated axes in the transformed coordinate system, and when ρ=0, axes of the ellipse are parallel to the original coordinate system.
Error Ellipses Method
The error ellipses method, first introduced by (Blachman, 1989), aims to combine individual probability distributions by the linear weighted averaging of the means. The optimal weighting minimizes the resulting variance of the combined distribution:
Cx=[i=1∑nCi−1]−1
where Cx is the minimized covariance matrix of the combined probability distribution, and Ci−1 is the inverse covariance matrix of the individual probability distributions. The estimated mean vector of the combined distribution is then defined by:
x=Cx[i=1∑nCi−1xi]
where x is the mean of the combined probability distribution.
Derivation of the Error Ellipse Equations-1D Case
Consider that {xi;i=1,...,n} are the means of n number of probability distributions, and {σi2;i=1,...,n} are the corresponding variances of these probability distributions. The unbiased estimate of the mean of the combined probability distribution is defined by:
x=i=1∑nλii=1∑nλixi
For independent estimates, the variance of the estimate x can be written as:
Var[x]=i=1∑n[λi/i=1∑nλi]2Var[xi]
Recall that Var[x]=E[x2]−{E[x]}2. Differentiating the equation given above with respect to λj guarantees the condition for the variance to be minimum:
λjVar[xj]=i=1∑nλii=1∑nλi2Var[xi]
The right hand side of the equation does not depend on j and therefore, λj is proportional to 1/Var[xj]. Substituting these weights into the first and second equations given above yields:
x=[i=1∑nVar[xi]−1]−1i=1∑nVar[xi]−1xi
Var[x]=[i=1∑nVar[xi]−1]−1
Finally, the mean of the combined distribution with the minimized variance can then be defined by:
x=Var[x]i=1∑nVar[xi]−1xi
Derivation of the Error Ellipse Equations in a Multivariate Case
Consider m independent sets of observations, O=[O1,...,Om] of the same target. Each observation Oi, i=1,…,m is an individual estimate of the target. The error ellipse of each observation is a contour of the Gaussian conditional probability density function P(x,y∣Oi) of the target (Blachman, 1989). Considering the Bayes’ theorem, for which the readers could refer to the lesson by (C. V. Deutsch & Deutsch, 2018), the aforementioned posterior distribution based on one set of observations can be defined by:
P(x,y∣Oi)=P(Oi)Pi(x,y)∗P(Oi∣x,y)
Provided that Pi(x,y) is constant over the area of interest, the likelihood can be defined by:
P(Oi∣x,y)=Pi(x,y)P(Oi)∗P(x,y∣Oi)
Assuming that the observations are conditionally independent given (x,y), the total conditional probability over all observations, P(O1,…,Om∣x,y) can then be defined as the product of individual likelihoods P(Oi∣x,y), that is,
P(O1,…,Om∣x,y)=i=1∏mPi(x,y)P(Oi)∗P(x,y∣Oi)
The conditional probability of the target given all observations is defined by the following function:
Because the prior P(x,y) and Pi(x,y) are assumed to be constant over the area of interest, they can be absorbed into a normalizing constant. P(Oi) and P(O1,…,Om) depend only on the observation and are normalizing constants. Therefore, the conditional probability distribution of the target given all observations is defined as follows:
P(x,y∣O1,…,Om)=K∗i=1∏mP(x,y∣Oi)
Because P(x,y∣Oi) is Gaussian, its conditional probability density function can be defined by:
P(x∣O1,…,Om)=K∗exp{−21i=1∑m(x−Oi)TCi−1(x−Oi)} where K is the scaling factor; x is the vector defining target location; Oi is the observation of x and Ci−1 is the inverse covariance matrix associated with observation Oi. The combined Gaussian mean is also its mode, which is found by differentiating the probability density function given above:
∂x∂p=K∗e−Em/2{−21∂x∂Em}
where Em is defined by:
Em=i=1∑m(x−Oi)TCi−1(x−Oi)
∂x∂Em=∂x1∂Em⋮∂xn∂Em
where m is the number of observations and n is the dimensionality of the vector x and O. Consider the case where there is a single observation, O1 then,
If only one set of observations Oi is considered, the best estimation of the target’s location x will be equal to that observation Oi(Orechovesky, 1996). Expanding the estimation by considering M observations:
Finally, the combined mean x and variance C are defined by:
x=Cm=1∑M(Cm−1Om),C=(m=1∑MCm−1)−1
Example
Consider two bivariate Gaussian distributions, X,Y∼N(μ,Σ). The variables of these random vectors are X=[X1,X2] and Y=[Y1,Y2]. The parameters of the aforementioned bivariate Gaussian distributions are μX=[4,6], μY=[3,8] and (2×2) positive definite covariance matrices ΣX, ΣY are:
ΣX=[0.70.90.91.9]ΣY=[0.5001.2]
Based on the parameters given above, the variables, X1,X2 and Y1,Y2 were simulated. Let {x1k,x2l;k,l=1,...,800} be the simulated samples of X1,X2, and {y1k,y2l;k,l=1,...,800} be the simulated samples of Y1,Y2. The histograms of the samples of the simulated variables are given in Figure 3.
Figure 3: Histograms of the simulated variables
The probability level (1−0.05=0.95), χ22(0.05)=5.99 is first selected, as explained in Step 1. This means that there is a 95% probability that the values of the random vectors X and Y will be inside the ellipses. The eigenvalues (Step 2) of ΣX and ΣY are calculated to be λX=[2.38,0.22] and λY=[1.2,0.5], respectively.
Considering the first bivariate Gaussian distribution defined by the random vector X, the variables are positively correlated ρ=0.78. Therefore, the axes of the ellipse will point in the directions of the eigenvectors (Step 3). The eigenvectors of ΣX are calculated to be υ1=[0.47,0.88]T and υ2=[0.88,−0.47]T. The lengths of the ellipse axes are calculated to be (25.99⋅2.38=7.55), (25.99⋅0.22=2.3). The axes of the 95% confidence ellipse of the random vector X are then defined by ±5.99⋅2.38⋅[0.47,0.88]T and ±5.99⋅0.22⋅[0.88,−0.47]T.
Considering the second bivariate Gaussian distribution defined by the random vector Y, the variables are independent. The eigenvalues of ΣY are equal to the variances of Y2 and Y1, respectively. As explained in Step 3, the axes of the ellipse are parallel to the original coordinate axes. The lengths of the axes are calculated to be (25.99⋅1.2=5.36), (25.99⋅0.5=3.46). The axes of the 95% confidence ellipse of the random vector Y are then defined by ±5.99⋅1.2⋅[0,1]T and ±5.99⋅0.5⋅[1,0]T. Figure 4 displays two-sigma ellipses for the given bivariate Gaussian distributions, enclosing approximately 86.5% rather than 95%.
Figure 4: Two-sigma error ellipses of the bivariate Gaussian distributions (approximately 86.5% coverage)
The variance Cx of the combined probability distribution is calculated as follows:
Based on the estimated variance Cx and the mean x, the bivariate Gaussian variables are simulated. The two-sigma error ellipse of the combined distribution is given in Figure 5.
Figure 5: Two-sigma error ellipses of the bivariate Gaussian distributions and the combined distribution (approximately 86.5% coverage)
Summary
The error ellipses method combines Gaussian probability distributions through precision-weighted means. In the univariate case, the combined mean falls between the input means and the lower variance distribution has the greatest influence. In the multivariate case, the matrix weights need not place the combined mean within the convex hull of the input means. This method is especially useful when there is no clear prior distribution, for example, in the estimation of parameters from diverse data sources. The method should not be used for spatial prediction when a reasonable prior model is available.
References
Blachman, N. M. (1989). On combining target-location ellipses. IEEE Transactions on Aerospace and Electronic Systems, 25(2), 284–287.
Deutsch, C. V., & Deutsch, J. L. (2018). An Application of Bayes Theorem to Geostatistical Mapping. In J. L. Deutsch (Ed.), Geostatistics lessons. Retrieved from https://geostatisticslessons.com/lessons/bayesmapping
Deutsch, C. V., & Journel, A. G. (1998). GSLIB - geostatistical software library and user’s guide. Oxford University Press.
Deutsch, J. L., & Deutsch, C. V. (2011). Plotting and checking the bivariate distributions of multiple Gaussian data. Computers & Geosciences, 37(10), 1677–1684.
Doyen, P. M. (1988). Porosity from seismic data: A geostatistical approach. Geophysics, 53(10), 1263–1275.
Doyen, P. M., Boer, L. D. den, & Pillet, W. R. (1996). Seismic porosity mapping in the Ekofisk field using a new form of collocated cokriging. In SPE annual technical conference and exhibition (pp. 21–30).
Johnson, R. A., & Wichern, D. W. (1988). Applied Multivariate Statistical Analysis. Prentice-Hall, Inc.
Orechovesky, J. R., Jr. (1996). Single Source Error Ellipse Combination (Master’s thesis). Naval Postgraduate School, Monterey, California. Retrieved from https://hdl.handle.net/10945/32273
Rezvandehy, M. (2016). Geostatistical reservoir modeling with parameter uncertainty in presence of limited well data (PhD thesis). University of Alberta, Edmonton, Canada.
Xu, W., Tran, T. T., Srivastava, R. M., & Journel, A. G. (1992). Integrating seismic data in reservoir modeling: the collocated cokriging alternative. In SPE annual technical conference and exhibition (pp. 833–842).
Cite this lesson as:
Erten, O., & Deutsch, C. V. (2020). Combination of Multivariate Gaussian Distributions through Error Ellipses. In J. L. Deutsch (Ed.), Geostatistics Lessons. Retrieved from https://geostatisticslessons.com/lessons/errorellipses