Simply talk about Bayes' theorem

Before deriving Bayes' theorem, learn a few definitions:
Conditional probability (also known as posterior probability) is the probability of event A when another event B has occurred. The conditional probability is expressed as P(A|B), which is read as "the probability of A under B conditions".
For example, for events or subsets A and B in the same sample space Ω, if an element randomly selected from Ω belongs to B, then the probability that the randomly selected element still belongs to A is defined as under the premise of B The conditional probability of A, so: P(A|B) = |A∩B|/|B|, and then divide the numerator and denominator by |Ω| to get the

joint probability, which represents the probability of two events occurring together. The joint probability of A and B is expressed as or .
Marginal probability (also known as prior probability) is the probability of an event occurring. The marginal probability is obtained as follows: In the joint probability, the undesired events in the final result are merged into their total probabilities, and they are eliminated (the total probability is obtained by summing discrete random variables, and the integral is used for continuous random variables. Get the full probability), which is called marginalization. For example, the marginal probability of A is expressed as P(A), and the marginal probability of B is expressed as P(B).
Next, consider a question: P(A|B) is the probability that A will happen if B happens.
First, before the occurrence of event B, we have a basic probability judgment on the occurrence of event A, which is called the prior probability of A, denoted by P(A);
secondly, after the occurrence of event B, we renew the probability of occurrence of event A. Evaluation, called the posterior probability of A, is represented by P(A|B);
similarly, before the occurrence of event A, we have a basic probability judgment on the occurrence of event B, called the prior probability of B, and use P (B) means;
similarly, after the occurrence of event A, we re-evaluate the probability of occurrence of event B, which is called the posterior probability of B, which is represented by P(B|A).
Bayes' theorem is based on the following Bayes formula:

The derivation of the above formula is actually very simple, which is derived from conditional probability.
According to the definition of conditional probability, the probability of

event A occurring under the condition of event B is the same, the probability of event B occurring under the condition of event A occurring.

Sorting and combining the above two equations, we can get:

Then, the above formula Divide both sides by P(B). If P(B) is non-zero, we can get the formula expression of Bayes' theorem:

Therefore, the Bayes formula can be directly derived from the definition of conditional probability. That is, because P(A,B) = P(A)P(B|A) = P(B)P(A|B), so P(A|B) = P(A)P(B|A) / P(B).

Guess you like

Origin blog.csdn.net/guyu1003/article/details/108188897