Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
MIDTERM EXAM ISyE6420
Please show necessary work to get full credit. The exam must be typed in word/latex/RMarkdown and
submitted as a pdf file. Please include the Win- Bugs/R/Python/Matlab codes as separate files.
Name Problem Chad Normal-uniform Genetic study Total Score /35 /25 /40 /100 1. Chad, Bayes, Car,
and Vacation. Chad is taking a Bayesian Analysis course. He believes he will get an A with
probability 0.7. At the end of semester he will get a car as a present form his rich uncle
depending on his class performance. For getting an A in the course he will get a car with probability 0.8,
for anything less than A, he will get a car with probability of 0.1. If Chad gets a car, he would travel to
Cocoa Beach with probability 0.7, or stay on campus with probability 0.3. If he does not get a car,
these two probabilities are 0.2 and 0.8, respectively. Figure 1: Chad on the road After the semester was over you
learn that Chad is in Cocoa Beach. What is the proba- bility that he got a car? Hint:
You can solve this problem by any of the 3 ways: (i) use of WinBUGS or Open- BUGS, (ii) direct simulation using Octave/MATLAB, R, or Python, and (iii) exact calcula- tion. 2. Normal-uniform. Consider the Bayesian model yi|θ ∼iid N(θ, σ2), θ ∼ Uniform(0, 1), for i = 1, · · · , n, where σ2 is known. Find the posterior distribution of θ. 3. Genetic study. A genetic study has divided n = 197 animals into four categories: y = (125, 18, 20, 34). A genetic model for the population cell probabilities is given by( 1 2 + θ 4 , 1− θ 4 , 1− θ 4 , θ 4 ) and thus, the sampling model is a multinomial distribution: p(y|θ) = n! y1!y2!y3!y4! ( 1 2 + θ 4 )y1 (1− θ 4 )y2 (1− θ 4 )y3 (θ 4 )y4 , 2 where n = y1+y2+y3+y4. Assume the prior distribution for θ to be Uniform(0, 1). To find the posterior distribution of θ, a Gibbs sampling algorithm can be implemented by splitting the first category into two (y0, y1 − y0) with probabilities (12 , θ4). Here y0 can be viewed as another parameter (or a latent variable). Thus, p(θ, y0|y) ∝ n! y0!(y1 − y0)!y2!y3!y4! ( 1 2 )y0 (θ 4 )y1−y0 (1− θ 4 )y2 (1− θ 4 )y3 (θ 4 )y4 . 1. Derive the full conditional distributions of θ and y0. 2. Implement Gibbs sampling in R, Matlab, Python, or Winbugs and obtain the posterior distribution of θ (plot the density). 3. Find the estimate and 95% credible interval of θ. Hint: 1 2 1 2 + θ 4 + θ 4 1 2 + θ 4 = 1 . 3