class: center, middle, inverse, title-slide # STA 360/602L: Module 3.11 ## Discussion session exercise ### Dr. Olanrewaju Michael Akande --- ## In-class exercise - Your friend agrees to conduct a poll for you, free of charge (lucky you!). -- - You give the following instructions: “Please ask about 25 people whether they are in favor of more gun control, and report back to me the number who are in favor.” -- - After a few days your friend returns with the poll results: there were `\(y = 20\)` in favor. “ -- - You then ask, "how many people did you ask?”Your friend says, "ummm, I dunno. You didn't ask me to record that. All I know is that it was about 25.” -- - <div class="question"> What model can we use to do inference here? </div> -- - **To be done during the discussion session.** --- ## Exercise - Do the following: 1. Using the full conditionals derived during the session, write a Gibbs sampler to sample from the joint posterior of `\(N\)` and `\(\theta\)`, using a starting value of `\(N = 50\)` and `\(\theta = 0.05\)`. Set burn-in to `\(2000\)` and then proceed to generate `\(10000\)` draws. 2. Look at the posterior densities for both parameters. Describe the distributions. 3. Give the quantile-based equal-tailed posterior credible interval for `\(\theta\)`, rounded to two decimal places. 4. What is the probability that exactly `\(20\)` people were polled? What can you takeaway from this? 5. What is the probability that exactly `\(25\)` people were polled? What can you takeaway from this?