73 Building a Bayesian model
Collard and coworkers did a simple experiment. They collected samples of carrion beetles (beetles that feed on decaying animal matter) and measured morphological features of the beetles of various species, collected from different sites at different times of the year.
Imagine that you are in a cabin in Maine. There are also plenty of carrion beetles in the area in which you are staying, so you are curious to look at the morphological features of the beetles in your area. Your plan to set up a trap near your cabin to collect specimens from a given species. For each beetle you collect, you will measure its mass and the length of its elytra.
a) Propose a generative model, including priors, for the probability distribution describing the observed elytra length and mass.
b) Now you will generate data sets that you might expect to observe in your experiment. To generate one of the data sets do the following.
- Draw a set of parameter values out of the probability distribution you constructed for the parameters (the prior).
- Use those parameters to parametrize the likelihood and draw 40 samples of beetle masses and elytra lengths out of it.
You can do this many many times to see how the data sets might look. Generate many such data sets and make plots of them. (You should think carefully about how you might want to plot these to best make clear to you how the data sets coming from your generative model may look.) Does this jibe with what you would expect from your experiment? If not, do you have any ideas why not?
c) Do not attempt this part of the problem until parts (a) through (c) are complete. You can access the measurements of Collard and coworkers here. Extract the measurements made of Nicrophorus orbicollis at location MASS 10 in trap 0. Does the measured data set fall within the data sets you might expect from your proposed generative model?