My Math Forum

My Math Forum (http://mymathforum.com/math-forums.php)
-   Probability and Statistics (http://mymathforum.com/probability-statistics/)
-   -   Baysian econometrics (http://mymathforum.com/probability-statistics/339618-baysian-econometrics.html)

canfly March 20th, 2017 10:42 AM

Baysian econometrics
 
Assume we have the following Bayesian problem. The prior for π is
P(π = 1/2) = P(π = 1/3) = 1/2.
We then observe X = x1+x2+....+x10 where x1,...,x10 iid


P(xi = 1) = 1 − P(xi = 0) = π
What is the posterior distribution for π when X = 5 ?
(Explain your computation)

romsek March 20th, 2017 12:19 PM

I'm going to use $\alpha$ rather than $\pi$

$P[\alpha| X] = \dfrac{P[X|\alpha]P[\alpha]}{P[X]}$

given $\alpha$ the $x_i$'s form a binomially distributed sequence.

$P[\text{X 1's}] = \binom{10}{X} \alpha^X (1-\alpha)^{10-X}$

and thus

$P[X | \alpha] = \binom{10}{X} \alpha^X(1-\alpha)^{10-X},~0 \leq X \leq 10$

$P[\alpha]=\dfrac 1 2$

so we end up with

$P[\alpha| X] = \dfrac{\frac 1 2 \binom{10}{X}\alpha^{X}(1-\alpha)^{10-X}}{\frac 1 2 \binom{10}{X}\left(\left(\frac 1 2\right)^{10} + \left(\frac 1 3\right)^X\left(\frac 2 3\right)^{10-X}\right)} $

$P[\alpha| X]=\dfrac{\alpha^{X}(1-\alpha)^{10-X}}{\left(\left(\frac 1 2\right)^{10} + \left(\frac 1 3\right)^X\left(\frac 2 3\right)^{10-X}\right)},~0 \leq X \leq 10,~\alpha \in \left \{\dfrac 1 2, \dfrac 1 3 \right \}$

I leave it to you to evaluate $P[\alpha | 5]$

canfly March 20th, 2017 12:58 PM

Thanks Romsek, very clear your demonstration. I have a serie of exercises in this field.

exercise:

You go to see a doctor because you broke your left thumb while using a
hammer. The doctor selects you at random to have a blood test for HIV,
which for the purposes of this exercise we will say is currently suspected to
affect 1 in 10,000 people in your neighborhood.
The test is such that the probability of a false positive is 1%. The
probability of a false negative is zero. You test positive. What is the new
probability that have HIV ?
(do the computation using Bayes theorem and explain the result).

romsek March 20th, 2017 01:13 PM

why don't you give it a go first and post your work if you have any problems.

canfly March 21st, 2017 10:25 AM

You are right Romsek, for the first i have done the same reasonning like you but i had some the difficult to get that the distribution of X is binomial.
THANKS FOR YOU ANSWER.

For the second, here is what i have done, is it correct? THanks for you help

I begin with this:
H: "event to have HIV"
Hc:" the opposite event of H"
T: positif test
N: negatif test
With the design of the tree ( i don't nkow how to put it here)

P(T)= (1/10000)*100%+1%*(1-1/10000)
P(T)=P(H)*P(T/H)+P(Hc)*P(T/Hc)=P(H)*P(T/H)+(1-P(H))*P(T/Hc) , thus

P(H)= (P(T)-P(T/Hc))/(P(T/H)-P(T/Hc))

romsek March 21st, 2017 12:02 PM

I find it a bit hard to decipher what you've written. Let me show it and you can compare the two.

$P[HIV]=\dfrac {1}{10000}$

$P[!HIV]= \dfrac{9999}{10000}$


Let $T=1$ be a positive test result. $T=0$ is a negative test result


$P[T|HIV]=1$

$P[T|!HIV] = 0.01$

$P[T] = P[T|HIV]P[HIV] + P[T|!HIV]P[!HIV] = 1\cdot \dfrac{1}{10000}+(0.01)\cdot \dfrac{9999}{10000} = \dfrac{10099}{1000000}$

we are after $P[HIV |T]$

$P[HIV|T] = \dfrac{P[T|HIV]P[HIV]}{P[T]}=\dfrac{1\cdot \frac{1}{10000}}{\frac{10099}{1000000}} = \dfrac{100}{10099} \approx 0.9902\%$

This shows that the test has far too high a false alarm rate for the a priori probability of having HIV rendering the text useless.

canfly March 21st, 2017 01:40 PM

OK I get the point, for P(T) we have the same result but after, I compute P(HIV) .

To get the power of the test, as you do, i have to compute P(HIV/T). So to be useful, the probability as to be egal to 1? this means, we can miss some HIV people with this kind of test.
Thanks a lot.

romsek March 21st, 2017 01:59 PM

Quote:

Originally Posted by canfly (Post 564923)
OK I get the point, for P(T) we have the same result but after, I compute P(HIV) .

To get the power of the test, as you do, i have to compute P(HIV/T). So to be useful, the probability as to be egal to 1? this means, we can miss some HIV people with this kind of test.
Thanks a lot.

No it's not that the test has a problem detecting people that actually have HIV. It's that the test detects too many people that don't have it.

The probability that you actually have HIV given positive test results is only 0.99%.

I took a look at $P[HIV|T]$ and saw that you need $P[T|!HIV]=10^{-4}$ for $P[HIV|T]\approx 50\%$ and $P[T|!HIV]=10^{-5}$ for $P[HIV|T]\approx 90\%$

canfly March 21st, 2017 04:56 PM

Quote:

Originally Posted by romsek (Post 564925)
No it's not that the test has a problem detecting people that actually have HIV. It's that the test detects too many people that don't have it.

The probability that you actually have HIV given positive test results is only 0.99%.

I took a look at $P[HIV|T]$ and saw that you need $P[T|!HIV]=10^{-4}$ for $P[HIV|T]\approx 50\%$ and $P[T|!HIV]=10^{-5}$ for $P[HIV|T]\approx 90\%$

ok I get it

canfly March 21st, 2017 04:58 PM

Thanks again for your help, for the next exercis, we have

Consider the density f(x|λ) = 1/λ*exp(−x) for x ≥ 0.

1) If the prior for λ ≥ 1 is uninformative i.e. π(λ) ∝ 1 what is the
posterior ? Is it proper ?
2) If the prior for λ ≥ 1 is π(λ) ∝ λ^(−2) what is the posterior ? Is it
proper ? Does it admit an expectation ? Does it admit a variance ?


All times are GMT -8. The time now is 11:16 PM.

Copyright © 2018 My Math Forum. All rights reserved.