Solve Problem 3.7.15 (page 128) from the textbook.
Hint: The command lapply could be useful.
Solve Problem 5.4.8 (pages 222-223) from the textbook.
The Mauna Loa Observatory in Hawaii has recorded atmospheric CO₂
concentrations since 1958. The dataset mauna-loa.csv
contains monthly mean \(CO_2\) values
(in parts per million, ppm).
Your task is to fit a smoothing spline to the monthly \(CO_2\) measurements. Make sure that you experiment with different smoothing parameters (or degrees of freedom) and comment on your findings. In particular, briefly explain how the smoothing parameter affects bias and variance.
Finally, fit a polynomial model with the same number of degrees of freedom. Plot all of your findings in the same coordinate system. What do you notice?