1 / 19

Homework Database

Homework Database. Please show as many steps as possible so you can get partial points even if you don’t get the final answer. Homework 1.

zlhna
Télécharger la présentation

Homework Database

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Homework Database Please show as many steps as possible so you can get partial points even if you don’t get the final answer.

  2. Homework 1 • Suppose your prior distribution for the proportion of Californians who support the death penalty has mean 0.6 and standard deviation 0.3. Use a beta distribution for this prior. A random sample of 1000 californians is taken, 65% support the death penalty. Plot the prior and posterior on the same plot. (3pts) (Gelman book 2.9).

  3. Homework 2 • Gelman book Exercise 2.1. θ is the probability that a coin will yield a “head”. Suppose the prior distribution on θ is Beta(4,4). The coin is spun 10 times, “heads” appeared fewer than 3 times. Calculate your exact posterior density. Using a graphic software, plot prior and posterior of θ on the same graph.(3pts)

  4. Homework 3 • Gelman book Exercise 2.2 (Predictive distributions) Two coins C1 and C2. Pr(heads|C1)=0.6, Pr(heads|C2)=0.4. Now choose one coin randomly and spin it repeatedly. The first two spins are tails, what is the expectation of the number of additional spins until a head shows up? (3pts) • If you knew which coin was chosen, the two spins are independent of each other. Show that not knowing which one, the two spins are not independent(1pt).

  5. Homework 4 • We observed y female births out of a total of n births. Prove that the posterior predictive probability of the next two births are not independent, i.e. the posterior predictive probability of the next two births are both female is not equal to the posterior predictive probability of the next birth being female -squared. (2pts)

  6. Homework 5 • Find the conjugate prior for Poisson distribution.(2pts)

  7. Homework 6 • Gelman book 2.10 a) 2pts

  8. Homework 7-10 • Gelman book 2.21 (a,b,c,d) 1pt each

  9. Homework 11 A random sample of n students is drawn from a large population. Their average weight is 150 pounds. Assume that the weight in the population are normally distributed with mean \theta and standard deviation 20. Suppose your prior for \theta is normal with mean 180 and standard deviation 40. • give your posterior distribution for \theta (as a function of n) --2pts b) If n=10, give 95% posterior interval for \theta.—1pt c) Using a graphic software, plot the prior, the likelihood (as a function of \theta) and posterior in the same plot—1pt. Observe the relationship of the 3. (Not required!) Re-Do b) c) with n=100 (Gelman book 2nd Ed. Ex 2.8)

  10. Homework 12 • Assume a non-informative improper prior on the standard deviation σof a normal distribution is • Prove that the corresponding prior density for σ2 is • 2pts (Gelman 2.19a)

  11. Homework 13 • Pre-post debate polling. ABC news polled 639 voters before the 1988 presidential debate and different 639 voters after. Let α1 be the proportion who favored Bush before the debate, and α2 after. Choose a noninformative prior. Plot a histogram of α2-α1. What is the posterior probability of a shift towards Bush (i.e. α2-α1>0)?

  12. Problem 21 The length of a light bulb has an exponential distribution with unknown rate θ. • Show that Gamma distribution is conjugate for θ given an independent and identically distributed sample of light bulb lifetimes.(2pts) • Suppose your prior for θ is a gamma distribution with coefficient of variation 0.5 (that is: sd/mean=0.5) A random sample of light bulbs is to be tested to measure their lifetime. If the coefficient of variation is to be reduced to 0.1, how many light bulbs should be tested? (2pts) Gelman book 2.21 a) c)

  13. Problem 22 • The football point spread problem, download the data from course homepage. a)Using a noninformative prior on σ2,determine the posterior distribution for σ2 (2pts) b)Suppose that we have prior belief we are 95% sure that σ falls between 3 and 20 points. Find an approximate conjugate prior that corresponds to this belief (can do this by trial and error on the computer) 2pts Gelman 2.23.

  14. Problem 23 • Assume that the number of fatal accidents in each year are Poisson distributed with a constant unknown rate θ and an exposure proportional to the passenger miles flown that year(see table on next page). Set a prior distribution for θ and determine the posterior distribution based on the data. (4pts) Gelman 2.13. Table 2.2

  15. Problem 31 • Gelman 3.3 An experiment was performed on the effects of magnetic fields on the flow of calcium out of chicken brains. Measurements on an unexposed group of 32 chickens had a sample mean of 1.013 and sample standard deviation of 0.24. Measurements on exposed group of 36 chickens had sample mean of 1.173 and sample sd of 0.20. • A) assuming that the measurements in the control (unexposed) group were from a normal distribution with mean μC and standard deviation σC, what is the posterior distribution of μC? Similarly, what is the posterior distribution of the treatment group μt? Assume a uniform prior on (μc,μt,logσc,logσt) (1 pt for writing down the joint prior for (μc,μt,σc2,σt2), 2 pt for deriving the posterior of μc, 1 pt for μt) • What’s the posterior distribution of μt-μc? You can obtain independent posterior samples of μt and μc then plot the histogram of the difference. (2pts) Obtain an approximate 95% posterior interval for μt-μc (1pts. Hint: use the quantile() function)

  16. Problem 32 • Knowing the posterior of σ2 is IG((n-1)/2, (n-1)S2/2 ) S2=(Sum of squares)/(n-1) • Show that (n-1) S2/ σ2 is a chi-square with n-1 degrees of freedom (2pts. Hint: InverseChisquare is a different parameter form of InverseGamma. The inverse of an inverseChi-square is a Chi-square)

  17. Problem 41 • Gelman book 2nd Ed. 5.9 a) 3pts. b) 1pt c) 1pt. Hint: choice of noninformative priors are on pages 134 and 136.

  18. Problem 42 • 5.13. Formulate the full model, clarify what each parameter corresponds to (2pts) • a) 2pt • c) 2pts • Describe what each graph is and the corresponding algebra and code, if any.

More Related