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, the Durbin and Koopman series from Rdatasets, is fitted with RBF(l, a) + WN(n) and a constant mean. Five years ahead, in 1975, the posterior marginal of $x$ is normal with mean $m = 907.03$ and standard deviation $s = 121.81$. The excess over a threshold $K$ is $R_K(x) = \max(x - K, 0)$, written R = max(x - 800, 0) for $K = 800$ in the statistics panel. Because $R_K$ is nonlinear and convex, its posterior expectation exceeds $R_K(m)$.
Exact expectation of the excess
For $X \sim \mathcal{N}(m, s^2)$ and $d = \frac{m - K}{s}$, integrating above the kink gives
$$ \begin{aligned} \mathbb{E}\max(X - K, 0) &= \int_{K}^{\infty} (x - K)\,\frac{1}{s}\,\varphi\!\left(\frac{x - m}{s}\right)\mathrm{d}x \\ &= s\,\varphi(d) + (m - K)\,\Phi(d) , \end{aligned} $$where $\varphi$ and $\Phi$ are the standard normal density and distribution function. The first term captures upper-tail spread while the second weights the mean excess by exceedance probability. Convexity gives $\mathbb{E}\max(X - K, 0) \ge \max(m - K, 0)$, with the Jensen gap peaking at $K = m$ at $\frac{s}{\sqrt{2\pi}} = 48.6$.
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 model with the four functions in µGauss ↗. The statistics card reports the mean of each $R_K$ in 1975 alongside the posterior mean and standard deviation of $x$.
Verification across four thresholds
| $K$ | $d$ | µGauss statistic | Closed form | $\max(m - K, 0)$ |
|---|---|---|---|---|
| $800$ | $0.879$ | $119.75$ | $119.75$ | $107.03$ |
| $900$ | $0.058$ | $52.19$ | $52.19$ | $7.03$ |
| $1000$ | $-0.763$ | $15.62$ | $15.62$ | $0$ |
| $1100$ | $-1.584$ | $2.94$ | $2.94$ | $0$ |
Evaluated at full precision in $m$ and $s$, the computed statistics agree with the closed form to a relative error of $3 \times 10^{-15}$ across all four thresholds. µGauss integrates transformed functions by splitting at smooth breakpoints and applying 1D quadrature on each piece, matching the analytical integral across the kink at $x = K$.
Size of the Jensen gap
At $K = 1000$ and $K = 1100$, the point forecast $907$ lies below the threshold, so evaluating $\max(m - K, 0)$ returns zero while the true expected excess remains $15.62$ and $2.94$ thanks to 22% and 6% exceedance probabilities $\Phi(d)$. Near the mean at $K = 900$, the gap reaches $52.19 - 7.03 = 45.2$, almost all of the $48.6$ maximum. Evaluating thresholded outcomes at the mean forecast omits this entire uncertainty adjustment.
Related notes: Sensitivities of the forecast to the parameters by horizon, Squared exponential kernel on the Nile flow. Exact transformed-forecast integration is developed in Gaussian process regression with symbolic kernels.