ASKurz / Statistical_Rethinking_with_brms_ggplot2_and_the_tidyverse_2_ed

The bookdown version lives here:
https://bookdown.org/content/4857/
Creative Commons Zero v1.0 Universal
125 stars 37 forks source link

residuals and history #47

Open ASKurz opened 1 year ago

ASKurz commented 1 year ago

McElreath is a little inconsistent with how he talks about residuals. The typical definition of residuals now a days is

$$r_i = y_i - \hat y_i,$$

but in McCullagh & Nelder (1989, p. 9), we read "Gauss defined he residuals with opposite sign to that in current use, i.e. by $X \beta - y$," which we might express in the notation above as

$$r_{i \text{, old}} = \hat y_i - y_i.$$

In chapters 5 through 7 or so, McElreath seems to use both. For example, on page 135, we read:

And then we compute the residuals by subtracting the observed marriage rate in each State from the predicted rate, based upon the model above (emphasis added)

But his plot on page 136 seems to use the conventional modern definition of residuals. Consider specifically defining residuals in chapter 5 of the ebook, referencing McCullagh & Nelder (1989, p. 9), and commenting on McElreath's usage. Note this issue also comes up with the R2_is_bad() function in chapter 7.