Your data
Rows with a missing x or y are skipped. Dates are read as decimal years, so lengths and periods come out in years.
Result
Dark band: where the curve itself lies, 95%. Light band: where a single new reading would fall, 95% (curve plus noise). Ringed dots are more than 3 SD from their leave-one-out prediction. The dashed line marks the last data point; to its right is the forecast.
Fitted settings, in your units
| Setting | Value | Note |
|---|
Kernels by evidence
Log marginal likelihood relative to the best. Differences of a few units are weak; tens are decisive. Evidence ranks fit inside the data; it does not promise a better forecast.
| Kernel | Difference | Settings fitted |
|---|
Method and citation
A Gaussian process treats the unknown curve as random, with the covariance between its values at two x values set by a kernel of their distance r. Given your points, the posterior mean and variance at any x follow in closed form (Rasmussen & Williams 2006, Algorithm 2.1): with K the kernel matrix plus noise and L its Cholesky factor, α = K⁻¹y, the mean is k*ᵀα and the variance k(x*,x*) − vᵀv, v = L⁻¹k*.
The kernel's settings (signal size, length scale, period, noise) are chosen by maximising the log marginal likelihood −yᵀK⁻¹y/2 − log|K|/2 − (n/2) log 2π with its exact gradient (eq. 5.9), using an L-BFGS optimiser (Liu & Nocedal 1989) in log space within bounds, from the default start plus seeded random restarts. y is centred and scaled first, as scikit-learn's normalize_y does. With the linear mean, the kernels are fitted to what a least-squares line leaves, and predictions use a straight line with a vague prior (section 2.7, eqs. 2.41–2.42), so the line's own uncertainty widens the band far from the data. The leave-one-out check uses the closed form of eqs. 5.10–5.12 (treating the line as known). The periodic kernel is MacKay's (1998) exp(−2 sin²(πr/p)/l²).
Verified by tests in the source against scikit-learn 1.9.1's GaussianProcessRegressor, on this page's example, for all seven kernels: the log marginal likelihood, its gradient, and the predictive mean and standard deviation agree to within 1e-9; from the same starting values, the fitted optimum matches or beats scikit-learn's in six kernels and, for the periodic kernel alone, stops at a different local optimum (both are reported in the source).
BibTeX
@book{rasmussen2006gaussian,
author = {Rasmussen, Carl Edward and Williams, Christopher K. I.},
title = {Gaussian Processes for Machine Learning},
publisher = {MIT Press}, address = {Cambridge, MA}, year = {2006},
isbn = {026218253X}, url = {https://gaussianprocess.org/gpml/}
}
@article{liu1989limited,
author = {Liu, Dong C. and Nocedal, Jorge},
title = {On the limited memory {BFGS} method for large scale optimization},
journal = {Mathematical Programming},
volume = {45}, pages = {503--528}, year = {1989},
doi = {10.1007/BF01589116}
}
@incollection{mackay1998introduction,
author = {MacKay, David J. C.},
title = {Introduction to {G}aussian processes},
booktitle = {Neural Networks and Machine Learning},
editor = {Bishop, Christopher M.},
series = {NATO ASI Series F}, volume = {168},
publisher = {Springer}, pages = {133--165}, year = {1998}
}
Limits
- A forecast is a continuation, not a cause. On this page's example, fitted on 2010-01 to 2023-09 and asked for the next 36 months, the best-evidence model missed by 1.08 ppm on average (root mean square), no better than repeating last year's month plus last year's rise (1.07 ppm), and only 42% of the months fell inside its 95% band: CO2 rose faster than the 2010–2023 line. With a constant mean instead of a line, the miss was 2.47 ppm and the band held 6%.
- Leave-one-out checks the inside, not the edge. The same fit put 96% of the points inside their leave-one-out 95% band. That says the band is honest between your points, not past them.
- Several peaks. The likelihood surface can have more than one maximum: for example, one that treats a seasonal pattern as noise and one that fits it. More restarts make finding the higher one likelier, never certain. A setting at the edge of its range is flagged.
- Cost grows as n³. Fitting 200 points with all seven kernels takes about 20 seconds in a browser (one kernel, a few); the page accepts up to 1,500 points. For more, average to a coarser step first.
- One x column, Gaussian noise. Counts, shares and heavy-tailed data break the Gaussian noise assumption; a transform (log, square root) often helps.
- Not modelled: several input columns (automatic relevance determination), noise that changes with x, a fully Bayesian treatment of the kernel settings, sparse approximations for large n, and the Mauna Loa model's four-term kernel in section 5.4.3 of the book.
Questions
What does Gaussian process regression give me that a trend line does not?
A curve that bends as much as the data say it should, and a band around it that is narrow where you have data and widens where you do not. It also tells you, in your own units, over what distance the curve changes (the length scale), whether it repeats and how often (the period), and how much the readings scatter around it (the noise).
How are the settings of the curve chosen?
By maximising the log marginal likelihood: the probability of your data under the model, averaged over every curve the kernel allows. It rewards fitting the points and penalises needless flexibility at the same time, so a very wiggly curve that threads every point loses to a smoother one unless the data really demand it. The optimiser starts from several points, because the surface can have more than one peak.
What is a kernel and which one should I pick?
The kernel says how alike two points are given how far apart they are, which fixes what kind of curve is plausible: very smooth (RBF), rougher (Matern), a mix of scales (rational quadratic), repeating (periodic) or repeating with drift (quasi-periodic). On auto the tool fits all seven and keeps the one with the highest evidence; the table shows how far behind each other kernel is. A difference of a few log units is small; tens of units is decisive.
What does the leave-one-out check tell me?
Each point is predicted from all the others, and the tool counts how many fall inside their 95% interval. About 95% means the band is honest inside the range of your data. Far less means the band is too narrow; far more means it is too wide. It is computed exactly from one fit, not by refitting n times.
Can I trust the forecast past my last point?
Less than the band suggests. On this page's example, a fit on January 2010 to September 2023 forecast the next 36 months with an average miss of 1.08 ppm, about the same as simply repeating last year's month plus last year's rise (1.07 ppm), and only 42% of the 36 months fell inside the 95% band, because CO2 rose faster than the straight-line trend. Treat a GP forecast as a smooth continuation of the past, not a model of what drives the series.
Is my data uploaded anywhere?
No. The file is read and fitted by JavaScript in this browser tab. There are no accounts, cookies or analytics vendors.
Example data: monthly mean CO2 at Mauna Loa Observatory, Hawaii, January 2010 to September 2026, from the NOAA Global Monitoring Laboratory (gml.noaa.gov/ccgg/trends), retrieved 2026-11-13; data courtesy of NOAA GML. December 2022 to early July 2023 were measured on Maunakea after the Mauna Loa eruption.