# Bayes' Theorem

## What Is Bayes' Theorem?

Bayes' Theorem, named after eighteenth century British mathematician Thomas Bayes, is a mathematical formula for deciding conditional probability. Conditional likelihood is the probability of an outcome happening, in view of a previous outcome having happened in comparable conditions. Bayes' theorem gives a method for reexamining existing expectations or hypotheses (update probabilities) given new or extra evidence.

In finance, Bayes' Theorem can be utilized to rate the risk of lending money to likely borrowers. The theorem is likewise called Bayes' Rule or Bayes' Law and is the foundation of the field of Bayesian statistics.

## Figuring out Bayes' Theorem

Applications of Bayes' Theorem are broad and not limited to the financial domain. For instance, Bayes' theorem can be utilized to decide the precision of medical test results by taking into consideration how probably any given person is to have a disease and the overall exactness of the test. Bayes' theorem depends on consolidating prior probability distributions to generate posterior probabilities.

Prior likelihood, in Bayesian statistical surmising, is the likelihood of an event happening before new data is collected. As such, it addresses the best rational assessment of the likelihood of a specific outcome in view of current information before a trial is performed.

Posterior likelihood is the changed likelihood of an event happening subsequent to taking into consideration the new data. Posterior likelihood is calculated by refreshing the prior likelihood utilizing Bayes' theorem. In statistical terms, the posterior likelihood is the likelihood of event A happening given that event B has happened.

## Special Considerations

Bayes' Theorem accordingly gives the likelihood of an event in view of new data that is, or might be, connected with that event. The formula can likewise be utilized to decide what the likelihood of an event happening might be meant for by speculative new data, assuming the new data will end up being true.

For example, think about drawing a single card from a complete deck of 52 cards.

The likelihood that the card is a king is four separated by 52, which equals 1/13 or roughly 7.69%. Recollect that there are four kings in the deck. Presently, assume it is revealed that the chose card is a face card. The likelihood the chose card is a king, given it is a face card, is four partitioned by 12, or roughly 33.3%, as there are 12 face cards in a deck.

## Formula for Bayes' Theorem

$\begin &P\left(A|B\right)=\frac{P\left(A\bigcap\right)}{P\left(B\right)}=\frac{P\left(A\right)\cdot{P\left(B|A\right)}}{P\left(B\right)}\ &\textbf\ &P\left(A\right)=\text\ &P\left(B\right)=\text\ &P\left(A|B\right)=\text\ &P\left(B|A\right)=\text\ &P\left(A\bigcap\right))=\text\ \end$

## Instances of Bayes' Theorem

The following are two instances of Bayes' Theorem in which the principal model demonstrates the way that the formula can be derived in a stock investing model utilizing Amazon.com Inc. (AMZN). The subsequent model applies Bayes' theorem to drug testing.

### Inferring the Bayes' Theorem Formula

Bayes' Theorem follows just from the adages of conditional likelihood. Conditional likelihood is the likelihood of an event given that another event happened. For instance, a simple likelihood inquiry might pose: "What is the likelihood of Amazon.com's stock price falling?" Conditional likelihood makes this inquiry a stride further by posing: "What is the likelihood of AMZN stock price falling given that the Dow Jones Industrial Average (DJIA) index fell prior?"

The conditional likelihood of A given that B has happened can be communicated as:

On the off chance that An is: "AMZN price falls" P(AMZN) is the likelihood that AMZN falls; and B is: "DJIA is now down," and P(DJIA) is the likelihood that the DJIA fell; then, at that point, the conditional likelihood articulation peruses as "the likelihood that AMZN drops given a DJIA decline is equivalent to the likelihood that AMZN price declines and DJIA declines over the likelihood of a reduction in the DJIA index.

P(AMZN|DJIA) = P(AMZN and DJIA)/P(DJIA)

P(AMZN and DJIA) is the likelihood of both An and B happening. This is likewise equivalent to the likelihood of A happening duplicated by the likelihood that B happens given that A happens, communicated as P(AMZN) x P(DJIA|AMZN). The way that these two articulations are equivalent prompts Bayes' theorem, which is written as:

on the off chance that, P(AMZN and DJIA) = P(AMZN) x P(DJIA|AMZN) = P(DJIA) x P(AMZN|DJIA)

then, at that point, P(AMZN|DJIA) = [P(AMZN) x P(DJIA|AMZN)]/P(DJIA).

Where P(AMZN) and P(DJIA) are the probabilities of Amazon and the Dow Jones falling, regardless of one another.

The formula makes sense of the relationship between the likelihood of the hypothesis before seeing the evidence that P(AMZN), and the likelihood of the hypothesis in the wake of getting the evidence P(AMZN|DJIA), given a hypothesis for Amazon given evidence in the Dow.

### Mathematical Example of Bayes' Theorem

As a mathematical model, envision there is a medication test that is 98% accurate, implying that 98% of the time, it shows a true positive outcome for somebody utilizing the medication, and 98% of the time, it shows a true negative outcome for nonusers of the medication.

Next, expect 0.5% of individuals utilize the medication. In the event that a person chose at random tests positive for the medication, the accompanying calculation can be made to decide the likelihood the person is really a client of the medication.

(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 assuming that a person tried positive in this scenario, there is a generally 80% chance the person doesn't take the medication.

## The Bottom Line

At its simplest, Bayes' Theorem steps through an examination result and relates it to the conditional likelihood of that experimental outcome given other related events. For high likelihood false positives, the Theorem gives a more contemplated probability of a specific outcome.

## Highlights

• Bayes' Theorem permits you to refresh the anticipated probabilities of an event by consolidating new data.
• It is many times employed in finance in working out or refreshing risk evaluation.
• The theorem has turned into a valuable element in the implementation of machine learning.
• Bayes' Theorem was named after eighteenth century mathematician Thomas Bayes.
• The theorem was unused for a long time as a result of the high volume of calculation capacity required to execute its transactions.

## FAQ

### What Is a Bayes' Theorem Calculator?

A Bayes' Theorem Calculator calculates the likelihood of an event A conditional on another event B, given the prior probabilities of A and B, and the likelihood of B conditional on A. It computes conditional probabilities in light of known probabilities.

### What Is the History of Bayes' Theorem?

The theorem was found among the papers of the English Presbyterian pastor and mathematician Thomas Bayes and distributed after death by being perused to the Royal Society in 1763. Long overlooked for Boolean calculations, Bayes' Theorem has as of late become more famous due to increased calculation capacity for playing out its complex calculations.These advances have prompted an increase in applications utilizing Bayes' theorem. It is currently applied to a wide assortment of likelihood calculations, including financial calculations, hereditary qualities, drug use, and disease control.

### What Does Bayes' Theorem State?

Bayes' Theorem states that the conditional likelihood of an event, in light of the occurrence of another event, is equivalent to the probability of the subsequent event given the principal event duplicated by the likelihood of the main event.

### How Is Bayes' Theorem Used in Machine Learning?

Bayes Theorem gives a helpful method to thinking about the relationship between a data set and a likelihood. All in all, the theorem says that the likelihood of a given hypothesis being true in view of specific noticed data can be stated as finding the likelihood of noticing the data given the hypothesis duplicated by the likelihood of the hypothesis being true no matter what the data, separated by the likelihood of noticing the data no matter what the hypothesis.

### What Is Calculated in Bayes' Theorem?

Bayes' Theorem works out the conditional likelihood of an event, in view of the values of specific related known probabilities.