[Liangshan heroes say IT] Outlaws example to explain to Bayes' theorem

0x00 Summary

Hu Yanzhuo see how to use Bayes' theorem to determine "whether they are public Ming Gege's henchmen."

0x01 IT concept

1. Bayes' theorem

Bayes' theorem is used to solve the "inverse probability" the problem, namely to predict a probability based on a limited number of past data. For example, to predict the probability of rain tomorrow is how much use limited information (past weather measurement data).

The underlying idea is : the new sample information observed in the previous corrected people's perception of things. It is like the beginning of human nature when only a minimal amount of prior knowledge, but with the continuous observation of practice to get more samples, the results of the law of nature makes it more tangible thorough.

2. Problem areas

  • Solving problems (A): Hu Yanzhuo want to know whether they are public Ming Gege confidant, with A to represent "Your brother is a confidant."

  • Known results (B): Big Brother bow down to you. Recorded as event B.

  • Reasoning results P (A | B): Big Brother wants to worship this event for you to judge you as a brother, as the probability of a confidant.

3. Related Terms

  1. Priori probability: the probability that the resulting analysis and based on past experience. As "seeking the cause and effect" problems "because" appears.

  2. The posterior probability: refers to what has happened after the demand that this incident was due to the size of the possibilities of individual factors. Posterior probability is the probability that after obtaining the information "known results" re-amended. It is "picking fruit to find because of" problems "due."

Priori probability is the probability analysis of data obtained from the previous, refers to the probability of occurrence of a class of things, the probability is determined based on historical data or subjective judgments unconfirmed. Probability posterior probability but then again be amended After obtaining the information, is the probability that a particular condition under a specific thing happened.

  • P (A): a priori probability of A, is called a priori because it does not take into account any factor B area.

  • P (B): a priori probability of B, is called a priori because it does not take into account any factor A area. Here is the result of the probability of B occurring.

  • P (A | B): B is known to occur after the conditional probability of A, B is the first, and then only A, B and because the value from being known as posterior probability of A.

  • P (B | A): B is the conditional probability that A occurs after known, is the first to have A and B only, but also because from the values ​​of A and B is the posterior probability of becoming.

  • P (B | A) / P (B): The likelihood function, which is an adjustment factor, i.e., adjusted to bring new information B, the prior probability function is such that more realistic probability.

4 corresponds to this question

  • Priori probability P (A): Big Brother can not know in advance whether Hu Yanzhuo regard him as a confidant, so only according to common sense (or past experience) to get a probability analysis to determine where is tentatively scheduled for 50 per cent (a big brother like you I do not like you two possibilities).

  • The posterior probability P (A | B): ie, after the B event "Big Brother worship" took place on the A event "Big Brother see you as a confidant," the probability of re-evaluation.

5. Thinking Mode

Equal to new ideas and old ideas multiplied by an adjustment factor (also called a likelihood ratio) .

We first estimated a priori probability, then add the results of the experiment to see if this experiment is strengthened or weakened prior probability to obtain real-time closer to the posterior probability.

Posterior probability factor adjustment x = a priori probability 
Probability posterior is P (A | B)
prior probability is P (A)
adjustment factor is P (B | A) / P (B)

Or to think in the following way:

After the sample information prior distribution + ==> posterior distribution

Before getting a new sample information, people's awareness of things is "a priori distribution."

After obtaining the new sample information, people adjust the perception of things as "posterior distribution."

That you have the old concept of the original P (hypothesis), the arrival of new evidence, P (assuming that | the evidence) is your new ideas. Equal to new ideas and old ideas multiplied by the likelihood ratio . P (B | A) / P (B) referred to herein as "likelihood ratio."

How to answer this question 0x02

1. Popular thinking

Hu Yanzhuo brother worshiped by this event on their own to determine the probability of big brother sees himself as a confidant.

Popular thinking: Hu Yanzhuo first estimate a value (a priori probability), then observe the new information constantly revised (likelihood function). That is, the use of "adjustment factor" to continue to modify the "prior probability") "

Bayesian formula:

Posterior probability P (A | B) = a priori probability P (A) x adjustment factor [P (B | A) / P (B)]

For this question, it is

 P (Big Brother value your | brother worship) = P (Big Brother you value) x [P (Big Brother because the value you just bow down) / P (Brother worship)]

How to popular thinking about this "adjustment factor" common understanding is:? Big Brother value you / (+ Brother Brother value you do not value your) . That is, "Big Brother value you," the proportion of the overall event event. So that it can be adjusted.

2. Specific problem-solving

2.1 How to find P (B)?

P (B) can be obtained based on experience, but generally use full probability formula, its meaning is: You can not know a thing independent probability of occurrence, but we can probability of its occurrence under various conditions to obtain accumulated.

P (B) = P (B | A) P (A) + P (B | -A) P (-A), where A is the referred to as the counter--A

In this problem the corresponding

P (Big Brother worship) = P (Big Brother value because you only worship) P (Big Brother you value) + P (Big Brother will not value you worship) P (Big Brother do not care about you)

2.2 Derivation subsequent

So Hu Yanzhuo get the following equation:

P (Big Brother value your | brother worship) 
= P (Big Brother you value) x [P (Big Brother because the value you just bow down) / P (Brother worship)]
= P (Big Brother you value) x [P (as brother you just bow down value) / [P (Big brother value because you only worship) P (Big brother you value) + P (Big brother will not value you worship) P (Big brother do not care about you)]]

Hu Yanzhuo found, for public Ming Gege Li Kui Dai Zong has not satisfied the first Pianbai for Dong Ping / Guan Sheng / Lu Junyi the head Pianbai satisfied. Big Brother will know someone does not really value the Assembly worship, but do not care about someone but will bow down to routine.

Therefore, Hu Yanzhuo draw the following calculation.

The following are common sense Hu Yanzhuo hypothesis 
p (your brother value) = 50%
p (not value your brother) = 50% or less is inductive reasoning based on observations Hu Yanzhuo P (Brother because you only bow down value)% = 20 is P ( your brother will not bow down value) = 80% Thus Hu Yanzhuo finally calculated as follows P (value your brother | brother bowed) = 50% x (20% / (20% x50% + 80% x50%)) = 20%






So from Big Brother Hu Yanzhuo worship of this can be seen, not big brother Hu Yanzhuo value. The big brother Hu Yanzhuo this probability value down.

3. Conclusion

Sentence Bayesian thinking, is the " point of view as the facts change ."

If I can master all the information for one thing, of course I can calculate an objective probability (classical probability). But life in the vast majority of the information is incomplete decision-faced, our hands only limited information. Since we can not get full information, we limited information in the case, as far as possible to make a good prediction. That is, on the basis of subjective judgment, you can estimate a first value (prior probability), then observe the new information constantly revised (likelihood function).

It's a bit like solving cases, results from speculative reason. You went to the scene to collect evidence (results). By superimposing the evidence, the killer features gradually clear. Eventually you select "believe" Who is the murderer.

Bayes said, you "believe" to a certain extent assumptions, should be represented by a probability --P (hypothesis) .

0x03 Reference

https://blog.csdn.net/weixin_40920228/article/details/80850489

https://cloud.tencent.com/developer/news/266248

https://blog.csdn.net/qq_28168421/article/details/83388776

Guess you like

Origin www.cnblogs.com/rossiXYZ/p/12128311.html
Recommended