Exercise

A Bayesian model of Zombie IQ

Zombies are stupid, and you and your colleagues at the National Zombie Research Laboratory are interested in how stupid they are. To the right, you have the Normal model we developed in the last video, but with the temperature data switched out with some zombie IQs fresh from the lab. What we're interested in is how much we can learn about the mean zombie IQ from this data. The model is complete, save for that we need to calculate the probability of each parameter combination in pars.

Instructions

100 XP
  • Use Bayes Theorem to calculate these probabilities and assign them to pars$probability to complete the model.

Here's Bayes theorem:

$$P(\theta|D) = \frac{P(D|\theta) \times P(\theta)}{\sum P(D|\theta) \times P(\theta)}$$

Where

  • \(\theta\) is a parameter combination,
  • \(D\) is the data,
  • \(P(D|\theta)\) is the likelihood
  • \(P(\theta)\) is the prior
  • \(P(\theta|D)\) is the probability of different parameter values given the data. This is what we want!