rmcelreath / stat_rethinking_2022

Statistical Rethinking course winter 2022
4.12k stars 445 forks source link

Bayesian Updating and Slide 2 #4

Open jsilverpa opened 2 years ago

jsilverpa commented 2 years ago

Hi Richard, thanks so much for the book and the course. Though I wasn't able to register for your course, I've been following along with the videos. I have an question and I hope it is ok to ask this here...

In Lecture 2, you explain the grid method have a slide about Bayesian updating. Your rules:

  1. State a casual model for how the observations arise, given each possible explanation.
  2. count ways data could arise for each explanation
  3. Relative plausibility is relative value from (2)

Your example uses throwing the globe and seeing if your finger lands on water or land so (2) above is easy to compute using the binomial distribution. But, how do you calculate (2) when your problem gets slightly more complicated (e.g. figuring out the probability that a posterior explanation data point is a good fit for matching a line to a set of real-valued data points)?

Thanks in advance.

rmcelreath commented 2 years ago

This is the topic of the lectures next week. The additional complication with a line is that there is more than one parameter to consider: an intercept and a slope. But otherwise grid approximation works the same way: pick pairs of intercepts and slopes, compute Pr(data|intercept,slope)Pr(intercept)Pr(slope) for each, normalize and you have the posterior distribution.