Question
Hierarchical modeling: The les school1.dat through school8.dat give weekly hours spent on homework for students sampled from eight dierent schools. Obtain posterior distributions for the
Hierarchical modeling: The les school1.dat through school8.dat give weekly hours spent on homework for students sampled from eight dierent schools. Obtain posterior distributions for the true means for the eight dierent schools using a hierarchical normal model with the following prior parameters:
0 = 7 , (0)^2= 5, (0)^2= 10, 0= 2, (0)^2 = 15, 0= 2.
a) Run a Gibbs sampling algorithm to approximate the posterior distribution of {,2, , ^2}. Assess the convergence of the Markov chain, and nd the eective sample size for {^2, , ^2}. Run the chain long enough so that the eective sample sizes are all above 1,000.
b) Compute posterior means and 95% condence regions for {^2, , ^2}. Also, compare the posterior densities to the prior densities, and discuss what was learned from the data.
c) Plot the posterior density of R =(^2)/(^2+^2) and compare it to a plot of the prior density of R. Describe the evidence for between-school variation.
d) Obtain the posterior probability that 7 is smaller than 6, as well as the posterior probability that 7 is the smallest of all the s.
e) Plot the sample averages y1,...,y8 against the posterior expectations of 1,...,8, and describe the relationship. Also compute the sample mean of all observations and compare it to the posterior mean of .
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