pages 228 and 229 The fit should be for y, not d: yfit <- gamlr(xbig, y) # in the book it is yfit <- gamlr(xbig, d) Then the residual on residual estimate becomes 9747, and Fig6.3 should be updated with new graphs