[Thinkbayes] Bayesian thinking Reading notes-1-Bayes theorem

Source: Internet
Author: User

Using the Bayes theorem, the most important thing at the moment is the hypothesis. is the unknown event known, but also to pay attention to the hypothesis of the whole process, can not start a new hypothesis, this assumption is often not comprehensive.

I found it myself. There are two kinds of hypothetical methods, one is naming and the other is timing. The whole process is reflected in the timing, assuming that the scope of consideration should start from the first relevant condition.

Give 3 examples of the original book:

Example 1, there are two baskets, a basket A is: 3/4 red ball, 1/4 yellow ball, another basket B is: 1/2 red ball, 1/2 yellow ball.

I got a red ball, so what's the probability that the red ball gets from the basket a?

1, let's see if we can use the Bayesian formula? This event can be divided into two sub-events, select the basket first, and then take the ball. The basket and the ball now look mutually exclusive. In this way, we have completed part of the sequencing. At the moment it is not very important to name, but I can say that I took the ball of this basket for the 1th basket, and another one for the No. 2nd basket.

2, we look at the prior distribution, the probability of picking a B and a ball is the same, are 1/2.

3, likelihood degree:

Suppose that A is 3/4;

Suppose that B is 1/2.

4, according to the full probability formula, we get the normalized constant, the constant is 5/8. That is our P (D). The real meaning of this value is that the probability of getting the red ball is 5/8, which seems to have some meaning.

5, it is easy to get a posteriori probability, 3/5.

In this case, I feel the timing is very important, our description is "take a ball, this ball is a red ball", but actually we see how we take, is to select a basket, and then take the ball from inside the basket.

I have been wrestling with the meaning of normalization constants, in some cases, the normalization constants have practical significance, in some cases for me not.

Example 2, the initial condition is the same, but I take one ball from each of the two baskets, one is red, the other is yellow (the number of balls is infinitely large). Can you tell me the probability of the red ball getting from basket a?

1. We still have to assume that. Although the number of balls is 2, the complexity does not necessarily multiply. Because we will assume this: I first select a basket, the basket is named 1th basket, from the basket to take out the red ball, from the other Basket (2nd) to take out the yellow ball. This will appear a small question, is my order affect the real results? No discussion at this time.

2. The prior distribution is still:

Assumption 1: Take the basket first A,1/2

Hypothesis 2: Take the basket first B,1/2 here to take the first after taking a direct decision to take out the red ball basket, should be for us is so assumed.

3. Likelihood degree,

Suppose 1:3/4 * 1/2 = 3/8

Suppose 2:1/2 * 1/4 = 1/8

In the case where we assume that the order is not affected by the actual result, it conforms to the full probability, so we get P (D) = 1/4. Practical significance? And so on, we calculate that the probability of two balls being yellow and red is obvious 1/8 and 3/8. In other words, the probability of a yellow and a red should be 1/2. Why did you get 1/4? Because we neglect to take the yellow ball first, that is to say the real positive hypothesis should include first take red or take yellow first. However, if you do not consider the succession, it will not affect the above assumptions between 1 and 2 ratio. So it is no problem to calculate the posteriori probability.

So what should be the complete modeling here?

1, select the box to take first, 2, take a ball, 3, take another ball.

A:1/2 1/4 1/2 =1/16

3/4 1/2 =3/16

B:1/2 1/2 3/4 =3/16

1/2 1/4 =1/16

This is the 1/2.

4. See here, the posterior probability is 3/4, that is, I take a ball, a yellow and red and I only take a red ball. The probability of the last red ball coming from a box is still different.

Example 3:

Monty Hall problem. This question I do not explain here, we ask for your own inquiry.

It is obvious why some people think that the alternative is the same, they should have no unknown problem known process, that is, no assumptions. This leads to the fact that they do not get the right probabilities when they really want to think in probabilities. Indeed, if I were to consider the intermediate steps, I would actually get the wrong probability based on my intuition.

At the same time, it is noteworthy that the Monty Hall must be clear about existing events and conditions.

Take a look at our premises and assumptions, regardless of the car behind that door, we will choose a door first. Then Monty opened the door is the b door, and there is no car behind the door. To tell the truth, this assumes I am a little guilty. Unlike the previous example, I am sure to know what kind of ball to take first does not affect the actual situation. With my cognitive ability, without thinking, I cannot confirm that the author's hypothesis will have any effect on the true probability.

Think about it, obviously, our prior distribution and the choice of what is not involved in any relationship (here is a question, what we said, open B, no car, on the prior probability of the impact? This cannot be considered here, and it is important that we assume it in the order in which it is actually occurring. It is important to note that the car is first placed behind the door, then we choose a door, and then open the B door. If you open the B door and then you don't have a car to think about it, it makes you feel fine. But the actual error has been made. )

Assumption 1: A car behind a door, 1/3

Suppose there's a car behind the 2:b door, 1/3.

Suppose there's a car behind the 3:c door, 1/3.

Hypothesis 1: Choose a door, Monty Select B, no car after B door 100%

Hypothesis 2: Choose a door, Monty choose b Door 1/2,b door no car 0

Hypothesis 3: Choose a door, Monty choose b Door 100%,b door no car 100%

So we see:

1/6

0

1/3

Get the correct p (D) = 1/2 The implication is that I chose the A-door &monty open B-door & the probability of not having a car is 1/2. This seems to have no practical significance.

The posterior probability is drawn, and indeed we should change our choice.

[Thinkbayes] Bayesian thinking Reading notes-1-Bayes theorem

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.