March 20th, 2017, 10:42 AM  #1 
Newbie Joined: Mar 2017 From: lyon Posts: 18 Thanks: 0  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) 
March 20th, 2017, 12:19 PM  #2 
Senior Member Joined: Sep 2015 From: USA Posts: 2,262 Thanks: 1198 
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)^{10X}$ and thus $P[X  \alpha] = \binom{10}{X} \alpha^X(1\alpha)^{10X},~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)^{10X}}{\frac 1 2 \binom{10}{X}\left(\left(\frac 1 2\right)^{10} + \left(\frac 1 3\right)^X\left(\frac 2 3\right)^{10X}\right)} $ $P[\alpha X]=\dfrac{\alpha^{X}(1\alpha)^{10X}}{\left(\left(\frac 1 2\right)^{10} + \left(\frac 1 3\right)^X\left(\frac 2 3\right)^{10X}\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]$ Last edited by romsek; March 20th, 2017 at 01:11 PM. 
March 20th, 2017, 12:58 PM  #3 
Newbie Joined: Mar 2017 From: lyon Posts: 18 Thanks: 0 
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). 
March 20th, 2017, 01:13 PM  #4 
Senior Member Joined: Sep 2015 From: USA Posts: 2,262 Thanks: 1198 
why don't you give it a go first and post your work if you have any problems.

March 21st, 2017, 10:25 AM  #5 
Newbie Joined: Mar 2017 From: lyon Posts: 18 Thanks: 0 
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%*(11/10000) P(T)=P(H)*P(T/H)+P(Hc)*P(T/Hc)=P(H)*P(T/H)+(1P(H))*P(T/Hc) , thus P(H)= (P(T)P(T/Hc))/(P(T/H)P(T/Hc)) 
March 21st, 2017, 12:02 PM  #6 
Senior Member Joined: Sep 2015 From: USA Posts: 2,262 Thanks: 1198 
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[THIV]=1$ $P[T!HIV] = 0.01$ $P[T] = P[THIV]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[HIVT] = \dfrac{P[THIV]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. 
March 21st, 2017, 01:40 PM  #7 
Newbie Joined: Mar 2017 From: lyon Posts: 18 Thanks: 0 
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. 
March 21st, 2017, 01:59 PM  #8  
Senior Member Joined: Sep 2015 From: USA Posts: 2,262 Thanks: 1198  Quote:
The probability that you actually have HIV given positive test results is only 0.99%. I took a look at $P[HIVT]$ and saw that you need $P[T!HIV]=10^{4}$ for $P[HIVT]\approx 50\%$ and $P[T!HIV]=10^{5}$ for $P[HIVT]\approx 90\%$  
March 21st, 2017, 04:56 PM  #9  
Newbie Joined: Mar 2017 From: lyon Posts: 18 Thanks: 0  Quote:
 
March 21st, 2017, 04:58 PM  #10 
Newbie Joined: Mar 2017 From: lyon Posts: 18 Thanks: 0 
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 ? 

Tags 
baysian, econometrics 
Thread Tools  
Display Modes  

Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Financial econometrics  exam question  Ku5htr1m  Economics  0  March 11th, 2016 12:36 PM 
Applied Statistics and Econometrics  sarwar  Probability and Statistics  0  September 19th, 2014 10:27 AM 
Linear algebra & Econometrics  BartL  Math Books  0  October 26th, 2010 12:17 AM 
Econometrics  princessanna57  Economics  1  September 11th, 2009 07:29 PM 