Question
Assume a generative model with Bernoulli data (X) and a uniform prior (): XBernoulli Uniform(0,1) Also, assume you observe data representing two successes and one
Assume a generative model with Bernoulli data (X) and a uniform prior ():
XBernoulli
Uniform(0,1)
Also, assume you observe data representing two successes and one failure.
Using greta or causact, update your prior forand generatea representative sample of 4,000 draws from the posterior distribution.
What is your updated probability thatis less than or equal to 50% (i.e.P(50%))?
Hint: This is not the quantile function as shown in the Bayesian Updating chapter. Instead, look at the representative sample of the posterior distribution and calculate the percentage of draws where theta is less than or equal to 50%. The following code could be used to do that:
drawsDF %>% mutate(under50 = ifelse(theta<0.50,1,0)) %>% summarize(avgUnder50 = mean(under50))
(Enter answer as a decimal - i.e. 12% would be entered as 0.12. Round to the nearest hundredths place)
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