First Bayesian Inference: RShiny

 

Preparation for Exercise 1: prior-data-posterior

The first exercise is to play around with data and priors to see how these influence the posterior. We have written a small software package in R with a nice interface. Click on the preview to open your interface!

 

 

 

Exercise 1: prior-data-posterior

The first exercise is to play around with data and priors to see how these influence the posterior.

Step 1: choose a type of distribution (i.e., Normal, uniform, truncated Normal) for the prior and fill in values for the hyperparameters.

Step 2: upload data: You can use the .csv files in the subfolder ‘’course materials/day 1/exercises/data and input files’ where data on IQ scores is available for different sample sizes (n=20 - 10,000). Start with the n=20 dataset.

Step 3: let the software (i.e., RJags) estimate the posterior distribution.

 

Use (1) different types of distributions, (2) different values for the hyperparameters, and (3) different data sets and see how these choices influence the posterior.

 

Question: Did you notice that the posterior is highly influenced by the prior specification for small data sets, but that the posterior is hardly influenced by the prior specifications for large data sets?

Question: Did you also notice that if you specify boundaries, either by using a uniform prior or by specifying boundaries for the truncated normal, that the posterior is affected if the data is close to these boundaries or falls even outside the permitted parameter space?