Monthly CO2 at Mauna Loa, 1958 to 2001. A GP with a sum of four kernels is conditioned on the data before the cut-off year and forecasts the rest: a smooth rising trend (K1, squared exponential), a seasonal cycle that may slowly change (K2, periodic × squared exponential), medium-term irregularities (K3, rational quadratic) and correlated noise (K4, squared exponential). Switch parts off to see what each one does to the forecast and to the marginal likelihood.
The hyper-parameters start at the values that maximise the marginal likelihood of the data up to 1990 (found offline); the four-part kernel and the model are as in Section 18.8.1, with the period of K2 free and a constant mean equal to the training average. The sliders change only the three parameters shown, all others stay at their fitted values. Data: the monthly averages of the 1958–2001 record bundled with statsmodels, a shorter record than the book's. The band is the 95% interval for the latent CO2 level, without the measurement noise.
code/ch18_gaussian_processes.py (Figure 18.29).