Statistics for Programmers-Table of Contents
We recommend that you read the following articles in advance.
-What is an event -Conditional Probability and Multiplication Theorem
Under the condition that event A occurs, the conditional probability when i-type event B occurs is calculated as follows.
Event B of type K is defined as B_1, B_2, B_3 ... B_i
, and they are excluded from each other.
The conditional probability that event Bi
will occur under the condition that event A will occur is calculated by the following formula.
P(B_i|A) = \frac{P(A∩B_i)}{P(A)}
In the part of P (A∩B_i)
,
Multiplication theorem(P(A∩B)=P(A)×P(A|B)
)Using,P(A)×P(A|B)
Substitute.
Then it will be replaced with the following formula.
P(B_i|A) = \frac{P(B_i) \cdot P(A|B_i)}{P(A)}
This is Bayes' theorem. Each variable has the following meaning.
variable | Description |
---|---|
P(A) | Probability of A occurring |
P(B) | Probability of B occurring (prior probability) |
P(A|B) | Probability of A occurring after B (conditional probability, likelihood) |
P(B|A) | Probability of B occurring after A (conditional probability, posterior probability) |
For details, please refer to Proof of Bayes' Theorem.
The probability that A will occur after B (conditional probability) × the probability that B will occur is Probability of B occurring after A (conditional probability) x same as probability of A occurring.
In other words
P(B_i|A) \cdot P(A) = P(A|B_i) \cdot P(B_i)
It means that.
Dividing both sides of this by P (A)
gives the following form.
P(B_i|A) = \frac{P(B_i) \cdot P(A|B_i)}{P(A)}
In addition, Bayes' theorem is often used in this way.
P(B_i|A) = \frac{P(B_i)\cdot P(A|B_i)}{\sum_{j=1}^{k}P(B_j)\cdot P(A|B_j)}
-Bayes' theorem -Proof of Bayes' theorem
Recommended Posts