posterior probability distribution

logistic_guy

Senior Member
Joined
Apr 17, 2024
Messages
2,214
Assume that the prior distribution for the proportion of defectives produced by a machine is

\(\displaystyle p\)​
\(\displaystyle 0.1\)​
\(\displaystyle 0.2\)​
\(\displaystyle \pi(p)\)​
\(\displaystyle 0.6\)​
\(\displaystyle 0.4\)​

Denote by \(\displaystyle x\) the number of defectives among a random sample of size \(\displaystyle 2\).

\(\displaystyle \bold{(a)}\) Find the posterior probability distribution of \(\displaystyle p\), given that \(\displaystyle x\) is observed.
\(\displaystyle \bold{(b)}\) Estimate the proportion of defectives being produced by the machine if the random sample of size \(\displaystyle 2\) yields \(\displaystyle 2\) defectives.
 
Assume that the prior distribution for the proportion of defectives produced by a machine is

\(\displaystyle p\)​
\(\displaystyle 0.1\)​
\(\displaystyle 0.2\)​
\(\displaystyle \pi(p)\)​
\(\displaystyle 0.6\)​
\(\displaystyle 0.4\)​

Denote by \(\displaystyle x\) the number of defectives among a random sample of size \(\displaystyle 2\).

\(\displaystyle \bold{(a)}\) Find the posterior probability distribution of \(\displaystyle p\), given that \(\displaystyle x\) is observed.
\(\displaystyle \bold{(b)}\) Estimate the proportion of defectives being produced by the machine if the random sample of size \(\displaystyle 2\) yields \(\displaystyle 2\) defectives.
Please show us what you have tried and exactly where you are stuck.

Please follow the rules of posting in this forum, as enunciated at:


Please share your work/thoughts about this problem
 
Since the sample size \(\displaystyle n = 2\), and we are counting the probability of the number of defectives independently, then we have a binomial distribution. That is:

\(\displaystyle f(x|p) = \binom{2}{x}p^x(1 - p)^{2 - x}\)

where \(\displaystyle x\) is the number of defectives.
 
Last edited:
The marginal distribution is:

\(\displaystyle g(x) = \sum f(x|p)\pi(p) = f(x|0.1)\pi(0.1) + f(x|0.2)\pi(0.2)\)


\(\displaystyle = \binom{2}{x}0.1^x(1 - 0.1)^{2 - x}0.6 + \binom{2}{x}0.2^x(1 - 0.2)^{2 - x}0.4\)


\(\displaystyle = \binom{2}{x}\bigg[0.1^x(0.9)^{2 - x}0.6 + 0.2^x(0.8)^{2 - x}0.4 \bigg]\)
 
We know that \(\displaystyle x = 0,1,2\), then

\(\displaystyle g(0) = \binom{2}{0}\bigg[0.1^0(0.9)^{2 - 0}0.6 + 0.2^0(0.8)^{2 - 0}0.4 \bigg] = 0.742\)


\(\displaystyle g(1) = \binom{2}{1}\bigg[0.1^1(0.9)^{2 - 1}0.6 + 0.2^1(0.8)^{2 - 1}0.4 \bigg] = 0.236\)


\(\displaystyle g(2) = \binom{2}{2}\bigg[0.1^2(0.9)^{2 - 2}0.6 + 0.2^2(0.8)^{2 - 2}0.4 \bigg] = 0.022\)

And we have this table:

\(\displaystyle x\)​
0​
1​
2​
\(\displaystyle g(x)\)​
0.742​
0.236​
0.022​
 
\(\displaystyle \bold{(a)}\) Find the posterior probability distribution of \(\displaystyle p\), given that \(\displaystyle x\) is observed.
The posterior probability distribution is given by:

\(\displaystyle \pi(p|x) = \frac{f(x|p)\pi(p)}{g(x)}\)

Then,

\(\displaystyle \pi(0.1|0) = \frac{0.1^0(0.9)^{2 - 0}0.6}{0.742} = \textcolor{blue}{0.655}\)


\(\displaystyle \pi(0.2|0) = \frac{0.2^0(0.8)^{2 - 0}0.4}{0.742} = \textcolor{red}{0.345}\)


\(\displaystyle \pi(0.1|1) = \frac{(2)0.1^1(0.9)^{2 - 1}0.6}{0.236} = \textcolor{blue}{0.458}\)


\(\displaystyle \pi(0.2|1) = \frac{(2)0.2^1(0.8)^{2 - 1}0.4}{0.236} = \textcolor{red}{0.542}\)


\(\displaystyle \pi(0.1|2) = \frac{0.1^2(0.9)^{2 - 2}0.6}{0.022} = \textcolor{blue}{0.273}\)


\(\displaystyle \pi(0.2|2) = \frac{0.2^2(0.8)^{2 - 2}0.4}{0.022} = \textcolor{red}{0.727}\)
 
\(\displaystyle \bold{(b)}\) Estimate the proportion of defectives being produced by the machine if the random sample of size \(\displaystyle 2\) yields \(\displaystyle 2\) defectives.
Let \(\displaystyle P\) be the proportion.

\(\displaystyle P = p_1\pi(0.1|2) + p_2\pi(0.2|2) = 0.1(0.273) + 0.2(0.727) = \textcolor{blue}{0.1727}\)
 
Top