#### BRIAN RUSSELL

VICE-PRESIDENT, GEOSOFTWARE. BRIAN.RUSSELL@GEOSOFTWARE.COM

#### Introduction

This tutorial is intended to illustrate the power of Bayes’ theorem using a straightforward seismic exploration example. This example will show how to evaluate the effectiveness of combining AVO attribute analysis with drilling results. As a tutorial, it is like many others used in the explanation of Bayes’ theorem, but instead of using examples like apples and oranges or white and black balls, I will use terminology that you can relate to as exploration geoscientists. Even with this relatively simple example, you will find Bayes’ theorem is not an easy concept to understand, since it involves fundamental ideas that derive from probability theory. However, I hope that by illustrating the concept using only four numbers (1, 2, 3, and 4) it will be easier to comprehend. In fact, my initial working title for this tutorial was “Bayes’ Theorem: As easy as 1-2-3-4”, but as I started writing the article, I soon realized that nothing about Bayes’ Theorem is easy!

#### An Exploration Example

An oil and gas company has drilled ten wells in an area with the intention of finding gas but has only had a success rate of 50%. That is, five of the wells were wet and the other five found commercial amounts of gas. However, seismic data was not used in the exploration process that led to the drilling of these wells. The company has recently hired an enterprising young geoscientist who went back to the well log and seismic data and performed AVO modeling and analysis on the ten wells. Her findings were that the seismic data that tied six of the wells produced a positive AVO result (that is, she would have recommended drilling a well based on the AVO work) and that the seismic that tied four of the wells produced a negative AVO result (she would not have proposed a well). These findings are shown in Table 1. Based on the information in Table 1, we would like to quantify how much confidence the AVO method will give us in drilling further wells.

However, it is difficult to make any quantitative predictions from the information as it is presented in Table 1. A better way to organize this information is shown in Table 2, in which the rows indicate whether the AVO response is positive (Y) or negative (N), the columns indicate whether the well is wet (W) or contains gas (G), and the values indicate the number of wells for each result. Notice in Table 2 that the sum of each row and column is given, as well as the total sum, which must equal 10.

Table 1. A summary of the AVO and drilling results for 10 wells, where the AVO response is either Y for a positive AVO anomaly or N for a negative AVO anomaly, and the fluid encountered in the well is either W for wet or G for gas.

Table 2. A summary of the AVO and drilling results of Table 1, where the rows indicate whether the AVO response is positive (Y) or negative (N), and the columns indicate whether the well is Wet (W) or contains gas (G), and the sums of the columns and rows and all values is given.

From Tables 1 and 2 it is obvious that there is not a perfect correlation between AVO success and drilling success since two of the AVO positives did not predict gas and one of the gas wells had a negative AVO. But since the company is going to drill more wells in the area, they would like to know if they can predict the probability of drilling a successful well using AVO from the information in Table 2. As I will show you, this can be done by applying Bayes’ Theorem. But to understand Bayes’ Theorem, first we must understand three types of probability: marginal, joint, and conditional. Luckily for us, Table 2 contains information on these three types of probabilities, but we first need to normalize the values in Table 2 by dividing by the number of wells, as shown in Table 3. Although I could simplify many of the fractions in the table, I am leaving them in the form shown there since they are easy to convert to decimal or percentage form because we had 10 wells. Because of the normalization, the values in both the columns and rows now sum to 1.

Table 3. The normalization of the values in Table 2 is found by dividing by the total number of wells, or 10. Notice that the sum of both the column and row values now equals 1.

Marginal Probability

P(A), where this is read as the probability of event A happening independently of other events. You will often see the letter A (or B) used to generalize probability results, and in our case there are four different events of interest: Y (positive AVO), N (negative AVO), W (wet sand), and G (gas sand). The marginal probabilities can be read from the normalized row or column sums in Table 3, where the decimal values are P(Y) = 0.6, P(N) = 0.4, P(W) = 0.5, P(G) = 0.5. Figure 1 shows graphically how to find the marginal probabilities using Table 3.

Figure 1. Extracting marginal probabilities from Table 3.

Several interesting observations come from looking at the marginal probabilities. First, the sum of P(Y) and P(N) and of P(W) and P(G) both equal 1, as can be seen on Table 3 and in Figure 1. This is telling us that there should be a 100% probability of one or the other outcomes happening in both cases. That is, the AVO response is either positive or negative and the result of drilling is either wet or gas. Obviously, we could add more categories, such as an indeterminate AVO response or an oil sand, and make the problem more complex, but in this case we have simplified our results to a binary choice for both events. Also, we see that the marginal probability of a positive AVO response is higher than the marginal probability of a negative AVO response, but the marginal probability of wet and gas drilling results are both 50%. Notice that these results conflict with each other, and we will find that Bayes’ Theorem gives us a way to quantify this. But first we need to discuss joint and conditional probability.

Joint Probability

Joint probability is written as
P(A,B), where this is read as the probability of both events A and B happening. The events A and B can represent any combination of Y, N, W, and G so there are only four realistic combinations: P(Y,W), P(Y,G), P(N,W), and P(N,G) (since the probabilities of P(Y,N) and P(W,G) are both equal to zero). These values can be read off Table 3 and are equal to: P(Y,W) = 0.2, P(Y,G) = 0.4, P(N,W) = 0.3, and P(N,G) = 0.1. To understand this graphically, Figure 2 is an annotated plot of the joint probabilities shown in Table 3.

Figure 2. Extracting joint probabilities from Table 3

There are two things to make note of in the joint probability. First, the order of the events can be changed. That is, P(Y,W) = P(W,Y). Second, the sum of the joint probabilities with the same event in both probabilities will give the marginal probability. That is, P(Y,W)+P(Y,G) = P(Y) = 0.6, or P(Y,W)+P(N,W) = P(W) = 0.5. Again, this is made clear by referring to Table 3.

Conditional Probability

Next, let’s discuss conditional probability, which will lead us to Bayes’ Theorem. Conditional probability is written as P(A|B), which is read as the probability of event A happening given that event B has happened. There is a very important difference between joint and conditional probability. For joint probability we saw that P(A,B) = P(B,A). That is, the order of the events inside the brackets does not matter. But for conditional probability, in general P(A|B) does not equal P(B|A). (It is only true if the two events are truly independent of each other). Therefore, we will have a total of eight conditional probabilities: P(N|G), P(G|N), P(N|W), P(W|N), P(Y|G), P(G|Y), P(Y|W), and P(W|Y).

To compute the conditional probability, let’s again go back to Table 3. The conditional probabilities are found by dividing the joint probabilities by the marginal probabilities. For example, the conditional probability of an AVO positive or negative response occurring given a gas sand is found by dividing the joint probabilities in the Gas (G) column by the marginal probability P(G) at the bottom of the column, or

Notice that the sum of P(Y|G) and P(N|G) in equations 1 and 2 is equal to 1.0 since there is a 100% probability of one of those two outcomes occurring. We could compute the conditional probabilities of all the possible combinations of events, but instead let’s just look at two other conditional probabilities: P(W|Y) and P(G|Y), which can be found by dividing the joint probabilities in the AVO (Y) row by the marginal probability P(Y) at the end of the row, or

Again, the sum of the probabilities in equations 3 and 4 gives us 1.0 since there is a 100% probability of one of the two outcomes occurring. Notice that the conditional probabilities in equations 1 and 4, P(Y|G) = 4/5 and P(G|Y) = 2/3, are not equal as stated earlier. These two conditional probabilities will lead us to the use of Bayes’ Theorem to evaluate the importance of AVO in de-risking drilling decisions. But before deriving Bayes’ Theorem, let’s take a simpler look at these two values. You may have noticed that in equations 1 through 4 the number 10 (the number of wells) was superfluous, since it cancelled out in all the computations. Therefore, a more intuitive way of understanding conditional probability is shown in Figure 3, where I have gone back to Table 2, rather than Table 3.

Figure 3. Extracting conditional probabilities from Table 2, without normalizing first.

Bayes’ Theorem

To understand Bayes’ Theorem, we must go back to the full definition of conditional probability given in equations 1 and 4, which is the division of joint probability by marginal probability. Since we know that the joint probabilities P(Y,G) and P(G,Y) are equal, we can re-arrange equations 1 and 4 as follows

In equation 11, the likelihood of the probability of getting a positive AVO response given that we have a gas sand, which is 4/5, or 80%. The prior represents our prior knowledge that we had a 1/2, or 50%, success rate for finding gas in our drilling. The evidence is the new information that we had a 3/5, or 60%, marginal probability of observing a positive AVO response. Finally, the computed posterior is the updated probability of a gas sand being drilled after considering the new information. This value is 2/3, 66.667 %. Thus, in this example we see that performing an AVO analysis prior to drilling will lead to improved drilling success. However, this is because the AVO information we have added to the problem was more accurate than the initial drilling decisions. If the likelihood had been equal to 3/5, the posterior would drop to 1/2, equal to the initial drilling results, and if the likelihood was equal to 2/5, the posterior would drop to 1/3, which is worse than the initial drilling results. In other words, the results depend on your own data and analysis. Although this was a made-up example, it was based on my experience that AVO usually helps in the exploration process.

With these results, we would like to think that the management of this company would let their new geoscientist perform AVO modelling and analysis before drilling another well. Let’s assume that she was given approval to go ahead with the AVO analysis for a new proposed well, found that it was positive, and got management to approve the drilling of a new well. And let’s say that the well is a success. We can then update Table 2 to read as shown in Table 4.

Table 4. The update of Table 2 assuming the 11th well is successful.

Since I have taught you all the “tricks” necessary to do a Bayesian analysis of these results, you should now be able to update the posterior as shown below.

But let’s assume the other scenario, that the new well was a failure. We would then update Table 2 to read as shown in Table 5.

Table 5. The update of Table 2 assuming the 11th well is a failure.

Now, the new posterior becomes.

Now, our confidence in using the AVO method to predict a gas well has gone down. We are still above 50%, but just barely. And thus, the process goes on. As we do more seismic modelling and analysis, and drill more wells, we can continually update our Bayesian results.

Conclusion

This tutorial was intended to illustrate the power of Bayes’ theorem using a straightforward seismic exploration example. In this example, an explorationist went back and analyzed the results of ten wells, of which five were dry holes and five were producers, using the AVO technique. I showed you that with Bayesian analysis, we could compute a quantitative value for the probable success of drilling a successful well using the AVO technique. But even with this simple example, you probably found that Bayes’ theorem was not an easy concept to understand, since it involves fundamental ideas that derive from probability theory. By going back through this problem and working with the numbers themselves, or perhaps in using an example from your own work, the concepts should become much clearer.

In this tutorial I assumed my readers were familiar with the AVO technique. If you are not familiar with AVO, I would recommend taking a course or reading one of the numerous books or Geophysics articles on the subject (e.g.: Castagna et al., 1993, Chopra and Castagna, 2014, Russell et al., 2002) However, the Bayesian method I described was not dependent on using AVO, and any seismic technology that you think would help in the exploration process, such as pre-stack seismic inversion or seismic attribute analysis, could be used instead.

Dedication

This article is dedicated to the memory of my good friend, mentor and colleague, Professor Larry Lines. The basic idea for this article came while I was pursuing my Ph.D. degree as a very mature student with Larry as my supervisor, over twenty years ago. I was using Bayesian analysis in my thesis and came up with this example as a way of understanding the method. One day, I wrote what was Table 2 in the tutorial on Larry’s whiteboard, and he liked it so much that he used it in his classes to illustrate Bayes’ Theorem. So, this is to the memory of a much beloved teacher and person.

References

Bayes, Thomas, 1763, An essay towards solving a Problem in the Doctrine of Chances: published in the Philosophical Transactions of the Royal Society of London, Vol. 53, p. 370.

Castagna, J. P., Batzle, M. L. and Kan, T. K., 1993, Rock physics – The link between rock properties and AVO response, in Backus, M. M., Ed., Offset-dependent reflectivity – theory and practice of AVO analysis: SEG, 135-171.

Chopra, S. and Castagna, J., 2014, AVO: Investigation in Geophysics Series No.16. SEG, 55.

Russell, B., Ross, C., and Lines, L., 2002, Neural networks and AVO: THE LEADING EDGE, 21, no. 3, 268-277.