homework4fall2010-key

# homework4fall2010-key - Stat 180/C236 Homework 4...

This preview shows pages 1–3. Sign up to view the full content.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Stat 180 / C236 Homework 4 J. Sanchez UCLA Department of Statistics The prior distribution is shown in ﬁgure ?? pdf("hwk4fall2010p1.pdf") theta=seq(0,1,length=500) plot(theta,dbeta(theta,1,2/3),type="l") dev.off() (b) A random sample of 1000 Californians is taken, and 65% support the death penalty. What are your posterior mean and variance for θ ? We can write down the likelihood as: p ( y | θ ) = n y ! θ y (1 - θ ) n - y and the posterior density as p ( θ | y ) Beta ( a + y , n + b - y ) = Beta (1 + 650 , 350 + 2 / 3) Then the posterior mean and variance of θ are E ( θ | y ) = 651 1000 + 1 + 2 / 3 = 0 . 65 Var ( θ | y ) = E ( θ | y )(1 - E ( θ | y )) a + b + n + 1 = 0 . 0002 The graph in ﬁgure ?? is the posterior distribution 0.0 0.2 0.4 0.6 0.8 1.0 0 5 10 15 20 25 theta dbeta(theta, 1 + 650, 350 + 2/3) Figure 2: Posterior distribution for the the proportion of Californians who support the death penalty. pdf("hwk4fall2010p1b.pdf")
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 11/24/2010 for the course STAT 201a taught by Professor Wu during the Spring '10 term at Pasadena City College.

### Page1 / 6

homework4fall2010-key - Stat 180/C236 Homework 4...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online