Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Section 4 Suppose we observe y_1, .., _n from a Poisson distribution with mean k, and the parameter A has a Gamma(a, b] distribution. A
Section 4 Suppose we observe y_1, .., _n from a Poisson distribution with mean k, and the parameter A has a Gamma(a, b] distribution. A = Gamma[ a, b) Y| A- Poisson[ A] n I exp(-A)10 [1"-1 exp(-bx)] 1=1 Use this information to answer the questions in this section. 15) Write your R code to create function "Ipost[)' and list's' Assume you observed Y=2, 5, 10, (20pts) 5, 6, as your sample data. and the prior parameters are a = 1 and b = 1. (Hint: See p.37 in Day 10 Slides and use 'sum(dpois( log=TRUE)) + dgammal .log-TRUE)' in 'lpost(") Verdana 10pt B O WORDS POWERED BY TINY Screen clipping taken: 14/04/2022 21:1816) Write your R code to collect 1,000 simulated Y values from the posterior distribution. Use (15pts) a starting value of 1=5 and a neighborhood scale value of C=2. Make sure you use "set.seed( 123 )' before your code to get the same outcome. (Hint: See p.38 in Day 10 Slides.) Verdana 10pt B IY E VEY ( > OWORDS POWERED BY TINY 17) Use your answer to Question 16 to find the acceptance rate. (10pts) 18) Write your R code to create a trace plot on your simulated Y values. (15pts) Verdana 10pt BIU E VEY ne
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started