









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!










The Bayesian Approach to Estimation
In the traditional approach to estimation and confidence intervals that we have been studying, an unknown population parameter is treated as fixed. For example, consider a 95% confidence interval for the unknown mean μ of a normal population with known standard deviation σ. Before the observations X (^) 1 , X (^) 2 , … , Xn are collected we can say that
P X 1.96 X 1.96. n n
Now suppose that we obtain the n observations and find that the confidence interval is
long run relative frequency with which intervals of the form
X 1.96 X 1. n n
observations from the population and computing a confidence interval for each of these
There is another approach to estimating unknown parameters and obtaining intervals for these parameters, called the Bayesian approach, that is based on a completely different paradigm. This approach represents prior information about an unknown parameter using a prior distribution. Once the data are obtained, Bayes Theorem is used to combine the prior distribution with the data to obtain what is called the posterior distribution for the parameter. This posterior distribution is actually proportional to the product of the likelihood function (for the fixed set of data) and the prior distribution. Once the posterior distribution is determined, it can then be used to obtain an estimate of
the unknown parameter or to obtain an interval for the parameter. The prior distribution for the unknown parameter can be obtained from past information about the parameter, or can be based on subjective knowledge. In the Bayesian approach the unknown parameter is treated as a random variable, so this approach is completely different from the classical approach in which the parameter is treated as fixed. Before explaining the Bayesian approach it will be useful to review Bayes Theorem, and consider the extension of this theorem to random variables. If the events A 1 (^) , A 2 , … , An form a partition of the sample space S , where P A ( (^) i ) > 0 , i = 1, 2, …, n , and B is an event with P B ( ) > 0 , then Bayes Theorem says that
1
j j^ j in j j
If X and Y are discrete random variables then we can apply Bayes Theorem (with B corresponding to X = x and Aj corresponding to Y = y ) to get
( | ) (^ |^ )^ (^ ) y (^ |^ )^ (^ )
P Y y X x P X^ x Y^ y P Y^ y P X x Y y P Y y
Writing this in terms of densities, we get
| | |
X Y Y Y X y X Y Y
f x y f y f y x f x y f y
If Y is a continuous random variable we get
| | |
X Y Y
f x y f y f y x = f x y f y dy ∫
π ( )θ , rather than as f ( ) θ , so that we can emphasize that this is the density of a parameter. We are also writing the density of X as f ( x | θ ) to emphasize that it is
X x f^ x θ f^ x
realistic continuous prior distribution later. Suppose that process engineers believe that p is usually around .05, but sometimes it is lower at around .01, and occasionally it is higher at around .10. Thus, they come up with the following discrete prior distribution
p .01 .05.
The mean of this prior distribution is
E p ( ) = (.01)(.2) + (.05)(.7) + (.10)(.1) = .047.
Thus, if this prior distribution is correct, then the long run average value of p will be 0.47.
We know that the value of p for the latest shift may be different from the long run average. We have 40 observations from the latest shift, and we want to use this information, along with the prior information, to obtain an estimate of p for the latest shift. Given that X = 1, the posterior distribution of p using Equation (1) is
1 39
1 39 1 39 1 39
p
X f f p p
By similar computations we obtain
(.05 | 1) (1| .05)^ (.05). p (1|^ )^ (^ )
X f f p p
and
(.10 | 1) (1| .10)^ (.10). p (1|^ )^ (^ )
X f f p p
Thus, the posterior distribution of p , given that X = 1 , is
p .01 .05.
The Bayes estimator is the mean of the posterior distribution, so we need to take expectation with respect to this conditional distribution of p , given that X = 1. This posterior distribution is discrete, so the mean from Equation (3) is
E p ( | X = 1) = (.01)(.21622) + (.05)(.75750) + (.10)(.02628) =.
We see that the Bayes estimate is p ˆ^ Bayes = .04266, and this is different from the MLE which is p ˆ^ MLE = .025. The Bayes estimate is different from the MLE because the Bayes estimator takes into account the prior information about how the p varies from shift to shift.
Example 2
Consider the same situation as in Example 1, except that engineers have arrived at an arguably more realistic continuous prior distribution of the form
1482 (1 )^37 0 ( ) 0 otherwise.
A plot of this prior density is shown below.
0.00 0.05 0.10 0.15 0.
30 25 20 15 10 5 0 Value of p
density
Prior Density
In what follows it will be useful to use that fact that if a and b are nonnegative integers , then
1 0
t a^ t b^ dt a b ∫ −^ = a + b +.
0.00 0.05 0.10 0.15 0.
30 25 20 15 10 5 0 value of p
density
Prior and Posterior Densities, n= 40, X = 1
The mean of this posterior distribution from Equation (4) is
1 2 76 0
E p X = = (^) ∫ p ⋅ (^) 2!76! p − p dp = (^) 2!76! 80! = 80 =
We see that the Bayes estimator, p ˆ^ Bayes = .0375, is between the MLE, p ˆ^ MLE = .025, and the mean of the prior distribution (.05). The posterior distribution can be used to calculate probabilities concerning p. For example, the probability that p for the latest shift is below .10 is
.10 2 76 0
P p ≤ X = = (^) ∫ (^) 2!76! p − p dp =
where the value of the integral was obtained using Minitab. Note that this probability would not be meaningful in the classical approach to statistics because the parameter p is treated as a fixed quantity in the classical approach.
Example 3
To extend Example 2, suppose that n = 40 components are inspected for another shift and the result for this shift is X = 4 defectives. The MLE is p ˆ (^) MLE = 4 / 40 = .10. For the Bayes approach we get the posterior distribution
( | 4) 79!^5 (1 )^73 5!73!
A plot of this posterior distribution (along with the prior shown as the solid line) is shown below.
0.00 0.05 0.10 0.15 0.
30 25 20 15 10 5 0 value of p
density
Prior and Posterior Densities, n = 40, X = 4
We see that this posterior distribution differs significantly from the prior distribution. The mean of this posterior distribution from Equation (4) is
1 5 73 0
E p X = = (^) ∫ p ⋅ (^) 5!73! p − p dp = (^) 5!73! 80! = 80 =
Thus, here the Bayes estimator p ˆ^ Bayes = .075is between the MLE, p ˆ^ MLE = .10, and the mean of the prior (which is still .05).
Example 4
As an additional extension of Example 3, consider the case in which there is a relatively large amount of data. In particular, suppose that n = 400 components are inspected for another shift and the result for this shift is X = 40 defectives. The MLE is p ˆ^ MLE = 40 / 400 = .10, the same as in Example 3. For the Bayes approach we get the posterior distribution
( | 40) 439!^41 (1 )^397
A plot of this posterior distribution, along with the prior distribution and the previous posterior distributions, is shown below.
Example 5 The life length X (in months) of a type of component has an exponential distribution with density
were observed and this resulted in the values
1.7, 8.4, 2.7, 5.4, 2.6, 11.3, 3.1, 1.
In what follows it will be useful to use the fact that if a > − 1 and b > 0 are constants then
(^0 ) a bt (^ 1) a t e dt a b
∞ −
where Γ( a + 1) = a !if a is a nonnegative integer. Now the n observations are assumed to be independent so
1 2 8 8 8 8 1 1 1
( , , , | ) ( (^) i | ) xi^ ni^ xi i i
= =
(^8 ) (^8 ) (^8 ) (^8 ) (^8 )
1 2 8 1 2 8 0 1 2 8 8 0. 8 0. 0 8 (0.12 ) 8 (0.12 ) 0 8 (0.12^ ) 8 1 9 8
i i i i i i i i i i
x x x x x i i
x x x f^ x^ x^ x f x x x d e e e e d e e d e x
α α α α α α α
=
∞ − ∑ − ∞ − (^) ∑ − − +∑ ∞ − +∑ − +∑ =
Using Equation (4) extended to X 1 (^) , X (^) 2 , … , Xn , the mean of this posterior distribution is
(^8 )
(^8 )
1 2 8 0 1 2 8 (^8 8 19) (0.12 ) 0 (^8 1 99) (0.12 ) 0 8 1 9 8 1 10
(^8 )
i i
i i
i i x
i i x
i i i i
i i
E x x x x x x d x (^) e d
x (^) e d
x x
x
α
α
=
=
∞ ∞ (^) = − +∑
= ∞^ −^ +∑
=
Consider now the problem of estimating the mean of the normal distribution, where we assume for simplicity that the variance of this distribution is known. In particular, suppose that we have n independent observations X 1 (^) , X (^) 2 , …, Xn from a normal
1 2 1 2 1 2
n^ n n
x x x f^ x^ x^ x f x x x d
and we first consider the numerator in this expression. Now the n observations are assumed to be independent so
2 2 2 2 1
(^1) ( ) 1 ( ) (^1 2 2) / 2^2 1
n n xi (^) i xi f x x xn (^) i e (^) n ne σ^ μ σ^ μ μ πσ π σ
and
2 02 0
(^1) ( ) 2 0
e σ^ μ^ μ
− − = ,
so this gives
2 2 02 (^2 1 )
2 2 2 02 (^1 )
(^1) ( ) 1 ( ) 1 2 2 2 / 2 (^0) (^1) ( ) 1 ( ) 2 2 ( 1) / 2 (^0)
n i i n i i
x n (^) n n x n n
f x x x e e
e
μ σ^ μ^ μ σ
σ μ σ μ^ μ
=
=
− (^) ∑ − −^ −
− (^) ∑ − − −
2 2
2 2
1 2 1 2 1 2 (^1) ( ) 2 (^1) ( ) 2
n^ n n
x x x f^ x^ x^ x f x x x d
e
e d
σ^ μ^ μ
σ μ^ μ
∗ ∗
∗ ∗
∞ −∞ − − ∗ ∞ −^ − −∞ (^) ∗
The integral in the denominator is 1, so we are left with (^1 2) ( ) 2 ( | 1 , 2 , , ) 1 2 n 2 x x x e σ^ μ^ μ
− (^) ∗ − ∗ … = ∗ ,
Example 6 Companies selling beverages in bottles use machines that rapidly fill the bottles as the bottles are moved under a head by a conveyer. The filling machines can be set to put in a certain amount of fill, but there is some random variation in fill from one bottle to another. Suppose that the actual amount of fill (in ounces) going into a bottle is a normal
oz, but process engineers have noticed that the filling machine has been having trouble maintaining the correct value of μ. These engineers have come up with a normal prior distribution for the current value of μ , and this prior distribution has mean μ 0 = 12 and
filled, and found that the average fill was X = 12.23 oz. They now want to find the probability that μ is currently above the desired value of 12 oz. Using the results given above for a normal mean with a normal prior distribution, we find that the mean of the normal posterior distribution from Equation (6) is 2 0 02 2 2 02 2 2 2
n x n
the variance from Equation (7) is
2 02 2 2 2 02 2 2 2
n (15)(.1) (.3).
distributions for μ are shown below.
11.7 11.8 11.9 12.0 12.1 12.2 12.3 12.
7 6 5 4 3 2 1 0
value of mu
density
Prior and Posterior Densities, n= 15, Xbar = 12.
The plot of the posterior density of μ indicates that it is likely that μ is above the desired value of 12 oz. The probability of this is
( 12 | 12.23) 12 12.144 ( 2.3474) 1 .0095. .
population, and not the variance of the sample mean X.
Homework Problems
of these components are observed. (a) Find the posterior density of α. (b) Find the Bayes estimator of α.
( ) (^) !, 0,1, 2, k k^ x f x = e^ − x x = … ,
and the prior distribution for k is
(a) Find the posterior density of k. (b) Find the Bayes estimator of k.
past data, a normal prior distribution for μ has been determined with mean
units was selected from the current shipment from the vendor, and it was found that the average output voltage was X^ =^ 5.03 V.
(a) Find the posterior distribution for the mean μ for the current shipment of power supply units. (b) Find the probability that μ is in the interval [4.95,5.05].
(a) Show that the Bayes estimator of μ in this case reduces to an average of n + 1 values, where one of these values is μ 0 and the other n values are the n observations X 1 (^) , X (^) 2 , … , Xn. This means that in estimating μ , the information in the prior distribution is treated as if the prior mean μ 0 represents a single observation. (b) Show that the variance of the posterior distribution in this case is the population variance divided by n + 1.