Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The perils of data-dependent priors One of the fundamental dictums of Bayesian statistics is that the prior must not depend on the observed data. In

image text in transcribed
The perils of data-dependent priors One of the fundamental dictums of Bayesian statistics is that the prior must not depend on the observed data. In this homework, we will see in a simple case that if we allow our priors to depend on the data, we can make control what the posterior looks like. Consider the model Yi - N(u, 1), i= 1,...,n with prior u- N(m, s), where m and s >0 may depend on the sample y. 1. What choice of m and s will make E(u | 3) = 1? What will the variance do as n oo? 2. Simulate data sets of size n = 10, 1000, 1000 with u = 1, j = 0, = -1, and u = -10. For each of these 12 data sets plot the prior from part 1. The plots should be arranged so each row is a different sample size and they should be produced using the ggplot2 package. Write a short paragraph commenting on the plot of the prior distribution. 3. Write a Stan program to sample from the posterior distribution described in part 1. For one of the data sets simulated in part 2, use the Stan program to sample from the posterior. Plot a histogram of the samples overlaid with the analytically derived posterior. Use the following code skeleton: data { int n; vector [n] y; real posterior_expectation; transformed data { real m; real s; // Define m and s; parameters { real mu; model { // Define model The perils of data-dependent priors One of the fundamental dictums of Bayesian statistics is that the prior must not depend on the observed data. In this homework, we will see in a simple case that if we allow our priors to depend on the data, we can make control what the posterior looks like. Consider the model Yi - N(u, 1), i= 1,...,n with prior u- N(m, s), where m and s >0 may depend on the sample y. 1. What choice of m and s will make E(u | 3) = 1? What will the variance do as n oo? 2. Simulate data sets of size n = 10, 1000, 1000 with u = 1, j = 0, = -1, and u = -10. For each of these 12 data sets plot the prior from part 1. The plots should be arranged so each row is a different sample size and they should be produced using the ggplot2 package. Write a short paragraph commenting on the plot of the prior distribution. 3. Write a Stan program to sample from the posterior distribution described in part 1. For one of the data sets simulated in part 2, use the Stan program to sample from the posterior. Plot a histogram of the samples overlaid with the analytically derived posterior. Use the following code skeleton: data { int n; vector [n] y; real posterior_expectation; transformed data { real m; real s; // Define m and s; parameters { real mu; model { // Define model

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications 22nd International Conference Dexa 2011 Toulouse France August/September 2011 Proceedings Part 1 Lncs 6860

Authors: Abdelkader Hameurlain ,Stephen W. Liddle ,Klaus-Dieter Schewe ,Xiaofang Zhou

2011th Edition

3642230873, 978-3642230875

More Books

Students also viewed these Databases questions