Bayes’ Theorem: What It Is, the Formula, and Examples
Bayes’ Theorem, named after 18th-century British mathematician Thomas Bayes, is a mathematical formula for determining conditional probability. Conditional probability is the likelihood of an outcome occurring based on a previous outcome in similar circumstances. Bayes’ Theorem provides a way to revise existing predictions or theories (update probabilities) given new or additional evidence.
In finance, Bayes’ theorem can be used to rate the risk of lending money to potential borrowers. The theorem, also called Bayes’ Rule or Bayes’ Law, is the foundation of Bayesian statistics.
Understanding Bayes’ Theorem
Applications of Bayes’ theorem are widespread and not limited to the financial realm. For example, Bayes’ theorem can be used to determine the accuracy of medical test results by considering how likely any given person is to have a disease and the general accuracy of the test. Bayes’ Theorem relies on incorporating prior probability distributions to generate posterior probabilities.
In Bayesian statistical inference, prior probability is the probability of an event occurring before new data is collected. In other words, it represents the best rational assessment of the probability of a particular outcome based on current knowledge before an experiment is performed.
The posterior probability is the revised probability of an event occurring after considering the new information. The posterior probability is calculated by updating the prior probability using Bayes’ Theorem. In statistical terms, the posterior probability is the probability of Event A occurring, given that Event B has occurred.
Bayes’ Theorem thus gives the probability of an event based on new information that is or may be related to that event. If hypothetical new information turns out to be accurate, the formula can also determine how it might affect the likelihood that an event will occur.
For instance, consider drawing a single card from a complete deck of 52 cards. Four kings are in the deck, so the probability that the card is a king is four divided by 52, which equals 1/13 or approximately 7.69%. Suppose it is revealed that the selected card is a face card. The probability that the selected card is a king, given that it is a face card, is four divided by 12, or approximately 33.3%, as there are 12 face cards in a deck.
The formula for Bayes’ Theorem
The probability of A occurring= The probability of B occurring=The probability of A given B= The probability of B given A�= The probability of both A and B occurring
Examples of Bayes’ Theorem
Below are two examples of Bayes’ theorem. The first example shows how the formula can be derived in a stock investing example using Amazon.com Inc. (AMZN). The second example applies Bayes’ Theorem to pharmaceutical drug testing.
Deriving the Bayes’ Theorem Formula
Bayes’ Theorem follows simply from the axioms of conditional probability, which is the probability of an event given that another event occurred. For example, a simple probability question may ask, “What is the probability of Amazon.com’s stock price falling?” Conditional probability furthers this question by asking, “What is the probability of the AMZN stock price falling given that the Dow Jones Industrial Average (DJIA) index fell earlier?”
The conditional probability of A, given that B has happened, can be expressed as:
If A is “AMZN price falls,” then P(AMZN) is the probability that AMZN falls; and B is “DJIA is already down,” and P(DJIA) is the probability that the DJIA fell; then the conditional probability expression reads as “the probability that AMZN drops given a DJIA decline is equal to the probability that AMZN price declines and DJIA declines over the probability of a decrease in the DJIA index.
P(AMZN|DJIA) = P(AMZN and DJIA) / P(DJIA)
P (AMZN and DJIA) is the probability of both A and B occurring. This is also the same as the probability of A occurring multiplied by the probability that B occurs given that A occurs, expressed as P(AMZN) x P(DJIA|AMZN). The fact that these two expressions are equal leads to Bayes’ Theorem, which is written as:
if, P(AMZN and DJIA) = P(AMZN) x P(DJIA|AMZN) = P(DJIA) x P(AMZN|DJIA)
then, P(AMZN|DJIA) = [P(AMZN) x P(DJIA|AMZN)] / P(DJIA).
P (AMZN) and P (DJIA) are the probabilities of Amazon and Dow Jones falling without regard to each other.
The formula explains the relationship between the probability of the hypothesis before seeing the evidence, P(AMZN), and the probability of the hypothesis after getting the evidence, P(AMZN|DJIA), given a hypothesis for Amazon given evidence in the Dow.
Numerical Example of Bayes’ Theorem
As a numerical example, imagine there is a drug test that is 98% accurate, meaning that 98% of the time, it shows an accurate positive result for someone using the drug, and 98% of the time, it shows an accurate negative result for nonusers of the drug.
Next, assume 0.5% of people use the drug. If a person selected at random tests positive for the drug, the following calculation can be made to determine the probability that the person is a user of the drug:.
(0.98 x 0.005) / [(0.98 x 0.005) + ((1 – 0.98) x (1 – 0.005))] = 0.0049 / (0.0049 + 0.0199) = 19.76%
Bayes’ Theorem shows that even if a person tests positive in this scenario, there is a roughly 80% chance the person does not take the drug.
What is the history of Bayes’s theorem?
The theorem was discovered among the papers of the English Presbyterian minister and mathematician Thomas Bayes and published posthumously after being read to the Royal Society in 1764.1 Long ignored in favor of boolean calculations, advances in calculation capacity have led to an increase in applications using Bayes’ theorem. It is now applied to various probability calculations, including financial calculations, genetics, drug use, and disease control.
What does Bayes’ theorem state?
Bayes’ Theorem states that the conditional probability of an event based on the occurrence of another event is equal to the likelihood of the second event given the first event multiplied by the probability of the first event.
What Is Calculated in Bayes’ Theorem?
Bayes’ Theorem calculates the conditional probability of an event based on the values of specific related known probabilities.
What is a Bayes’ theorem calculator?
A Bayes’ Theorem Calculator figures the probability of Event A conditional on Event B, given the prior probabilities of A and B, and the probability of B conditional on A. It calculates conditional probabilities based on known probabilities.
How Is Bayes’ Theorem Used in Machine Learning?
The Bayes theorem provides a valuable method for thinking about the relationship between a data set and a probability. In other words, the theorem says that the probability of a given hypothesis being actual based on specific observed data can be stated as finding the probability of observing the data given the hypothesis multiplied by the probability of the hypothesis being true regardless of the data, divided by the probability of observing the data regardless of the hypothesis.
At its simplest, Bayes’ Theorem takes a test result and relates it to the conditional probability of that test result given other related events. For high-probability false positives, the theorem gives a more reasoned likelihood of a particular outcome.
Conclusion
- Bayes‘ Theorem allows you to update the predicted probabilities of an event by incorporating new information.
- Bayes’ Theorem was named after 18th-century mathematician Thomas Bayes.
- It is often employed in finance to calculate or update risk evaluations.
- The theorem has become a helpful element in the implementation of machine learning.
- The theorem was unused for two centuries because of the high calculation capacity required to execute its transactions.