1. Math
  2. Statistics And Probability
  3. matlab notes b find likelihood for each sequence 19 for...

Question: matlab notes b find likelihood for each sequence 19 for...

Question details
MATLAB

Sequences: Coin 1: HHTHT Coin 2: THTTT Coin 3: HHHHH Coin 4: THTTHTHTHT Coin 5: HHTHHHHHTH Coin 6: TTTTTTTTTT .Coin 7: THTTHTTHHTHTHTTHTHTTTHTTHT Coin 8: HHTHHHHTHHHTHHHTHHHHHTHH H H Coin 9: HHHHHHHHHHHHHHH HH HHHHHHHHH
(b) (5 points) To model peoples responses to this experiment, compare the following hypotheses h: fair coin, P(Headsj H) -0.5. In this case, the probability of a sequence given Hi only depends on the length of the sequence, H + T, because heads and tails are equally likely: H2: weighted coin, P(Heads|θ,H2) requires marginalizing over the unknown coin weight 6: 6; P(θ|H2)-Uniform (0,1). Computing P (DI . 0 Later in the course, we will solve this integral analytically. For now, compute a discrete approximation to the integral by a Riemann sum using the midpoint rule: PCD[H2)s> P(D1%)p@n). where 6n-(2n-1)/2N , and P(%) :-1/N. Use N-I00 for this problem. To test between these hypotheses, use the log posterior odds ratio: P(H2ID) log P(Hal D) = P(DIH2)P(H2) P(D|H1) (H1) log Compute the log posterior odds ratio for each of the above coin flip sequences, assuming P(H)/P(H)-1. Using the MATLAB function bar, plot the average human judgments from both conditions against the model log posterior odds for all coin flip sequences. How well does the model capture peoples judgments in each condition? Are there any systematic differences between people and the model? Submit your code along with your results. (e) (4 points) One reason why the model might deviate from a participants judgments is th equal priors: P(HyP(Hh) - 1. What is the effect of varying P(H) on the log posterior odds? Explain why this effect occurs. Can you draw any conclusions about which values of P(Hi) fit your participants judgments best in each condition? Submit your code along with your results. Try out other assumptions for P(H) (remember that P(Hhy-1-P)
Notes: B)
Find likelihood for each sequence 1-9 for each hypothesis.
First hypothesis with the fair coin (theta value = 0.5): what is the probability that we can get each sequence, 1 through 9.
Second hypothesis with weighted coin(don’t know theta value): what is likelihood of getting sequence 1 through 9. Using equation to find all possible hundred theta values. For each theta value we need to compute likelihood.
Then we sum them up across all possible theta values. Then we get likelihood under the second hypothesis
Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution