Scope note: This note fits a statistical model to a published series to show how a kernel represents structure. The forecast extrapolates that model. It is not a projection from the physics, ecology or economics of the series, and the series is used as published, without the corrections a domain analysis would apply.
The yearly flow of the Nile at Aswan from 1871 to 1970, in units of $10^8\,\mathrm{m}^3$, is the Durbin and Koopman series from Rdatasets. Its values scatter around a level that moves gradually from year to year. A Gaussian process with constant mean $\mu$, squared exponential covariance, and independent noise models this decomposition:
$$ \begin{aligned} y_i &= \mu + x(t_i) + \varepsilon_i , \\ \operatorname{Cov}\bigl(x(s), x(t)\bigr) &= \sigma^2 \exp\!\left(-\frac{(s-t)^2}{2\ell^2}\right) , \\ \varepsilon_i &\sim \mathcal{N}(0, \sigma_\varepsilon^2) , \end{aligned} $$written RBF(l, a) + WN(n) with trend degree $0$. Fitting by marginal likelihood gives a log likelihood of $-638.3$ and a BIC of $1295$, with all 4 restarts reaching the same maximum.
| Name | Symbol | Value | Standard error |
|---|---|---|---|
l | $\ell$ | $2.59$ years | $0.83$ |
a | $\sigma$ | $119$ | $22$ |
n | $\sigma_\varepsilon$ | $116$ | $11$ |
| $\beta_0$ | $\mu$ | $919$ | $32$ |
Run this in µGauss
Open µGauss with this model pre-loaded to inspect the fit, forecast, and parameter sensitivities, or adjust the kernel and refit:
- Open the Nile fit with the forecast values of this note in µGauss ↗. The statistics card shows the posterior mean and standard deviation of $x$ in 1971, 1975, 1980, and 1990.

RBF(l, a) + WN(n). The bands widen to a constant width within roughly ten years after the end of the data.Correlation decay with length scale
Between two times $h$ years apart, the smooth component has correlation $\exp\!\left(-\frac{h^2}{2\ell^2}\right)$. Evaluating at $\ell = 2.59$ years gives
| $h$ in years | $1$ | $2$ | $5$ | $10$ |
|---|---|---|---|---|
| Correlation | $0.93$ | $0.74$ | $0.15$ | $5.8 \times 10^{-4}$ |
so the level retains most of its value from one year to the next and decorrelates after five. Because the standard error of $\ell$ is roughly a third of its estimate, the data constrain this correlation range only loosely.
Share of noise
The signal amplitude and noise standard deviation are nearly equal at $119$ and $116$. The noise variance accounts for the fraction
$$ \begin{aligned} \frac{\sigma_\varepsilon^2}{\sigma^2 + \sigma_\varepsilon^2} &= \frac{116^2}{119^2 + 116^2} \\ &= 0.49 \end{aligned} $$of the marginal variance around $\mu$, while the smooth level carries the remaining $0.51$. Without the white-noise term, the smooth kernel would have to absorb year-to-year scatter directly into the level by shrinking $\ell$.
Mean reversion beyond the data
A stationary kernel holds no memory much past $\ell$. Beyond the last observation in 1970, the posterior mean of $x$ reverts to $\mu = 919.4$ and its standard deviation approaches the prior spread:
| Year | Mean of $x$ | Standard deviation of $x$ |
|---|---|---|
| $1971$ | $807$ | $84.7$ |
| $1975$ | $907$ | $121.8$ |
| $1980$ | $919.4$ | $123.1$ |
| $1990$ | $919.4$ | $123.1$ |
Because the constant trend uses the uncertain mode, the standard error $s_\mu = 32$ adds in quadrature, giving $\sqrt{\sigma^2 + s_\mu^2} = \sqrt{119^2 + 32^2} = 123$ rather than stopping at $\sigma = 119$. After roughly four length scales, a stationary kernel offers no information beyond the unconditional mean and spread of the series.
Comparing Matérn smoothness orders
The squared exponential enforces infinitely differentiable sample paths. Replacing it with Matérn kernels of order $\frac{3}{2}$ or $\frac{1}{2}$ produces rougher levels:
| Kernel | Log likelihood | BIC |
|---|---|---|
RBF(l, a) + WN(n) | $-638.3$ | $1295$ |
Mat32(l, a) + WN(n) | $-637.6$ | $1294$ |
Mat12(l, a) + WN(n) | $-637.0$ | $1292$ |
Across all three models, the BIC varies by only $3$ points, which is weak evidence and leaves the smoothness of the flow unresolved. You can open the Matérn $\frac{3}{2}$ fit in µGauss ↗ or open the Matérn $\frac{1}{2}$ fit in µGauss ↗.
Related notes: Changepoint kernel with a tanh switch, Exponential kernel as an AR(1) process. The mathematics of the kernel and forecast is developed in Gaussian process regression with symbolic kernels, and the workbench fields are documented in the µGauss reference.