Interactive model — experiment with these parameters in µGauss

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 number of lynx trapped in the Mackenzie River district from 1821 to 1934, the Elton and Nicholson series from Rdatasets, oscillates with a period near ten years while peak heights vary from cycle to cycle. A stationary model for such quasi-periodic fluctuations multiplies a cosine by a correlation envelope,

$$ k(\tau) = \sigma^2\,\rho(\tau)\cos\frac{2\pi\tau}{p} , $$

with $\tau = s - t$ and $\rho(0) = 1$. Whenever $\rho$ is a valid positive semi-definite correlation function, its product with the cosine kernel remains valid, and the rate at which $\rho$ decays governs how long a cycle remembers its phase.

Comparing three cycle envelopes

The bundled lynx example in µGauss uses the spectral mixture term SM(p, l, a), whose envelope is Gaussian, $\rho(\tau) = \exp\!\left(-\frac{\tau^2}{2\ell^2}\right)$. An exponential envelope $\rho(\tau) = \exp\!\left(-\frac{\lvert\tau\rvert}{\tau_e}\right)$ can be authored directly with declared parameter roles,

a^2 * exp(-abs(s - t) / tau) * cos(2 * pi * (s - t) / p)
where a: amplitude, tau: lengthscale, p: period

while the locally periodic kernel LocalPer(p, lp, l, a) pairs a Gaussian envelope with a periodic factor in place of the cosine. All three specifications use a constant mean. The exponential fit omits WN(n) because adding white noise pushes its noise parameter to the lower bound, whereas the other two models include noise.

EnvelopeKernelLog likelihoodBICPeriod in yearsRestarts at best
GaussianSM(p, l, a) + WN(n)$-939.0$$1902$$9.24 \pm 0.95$3 of 4
Exponentialcustom formula, no noise$-935.5$$1890$$9.93 \pm 0.64$4 of 4
Locally periodicLocalPer(p, lp, l, a) + WN(n)$-931.4$$1891$$9.37 \pm 0.34$2 of 4

The exponential envelope outperforms the Gaussian envelope by $12$ in BIC using one fewer free parameter. LocalPer achieves a higher log likelihood at the cost of one additional parameter, leaving its BIC of $1891$ statistically indistinguishable from $1890$.

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:

Fit and forecast of the lynx series with the Gaussian envelope showing the fitted mean oscillating through the data and a forecast that flattens to the mean within about one cycle Fit and forecast of the lynx series with the Gaussian envelope showing the fitted mean oscillating through the data and a forecast that flattens to the mean within about one cycle
The Gaussian envelope. The forecast oscillates for roughly one cycle before collapsing toward the mean.
Fit and forecast of the lynx series with the exponential envelope showing the fitted mean oscillating through the data and a forecast that keeps oscillating across multiple cycles Fit and forecast of the lynx series with the exponential envelope showing the fitted mean oscillating through the data and a forecast that keeps oscillating across multiple cycles
The exponential envelope. Oscillations persist well past the first forecast cycle.

Correlation after one period

At lag $\tau = p$, the cosine factor equals $1$, so the one-period autocorrelation is simply $\rho(p)$. Across the three fitted envelopes, this correlation differs by two orders of magnitude:

EnvelopeCorrelation after one periodAfter two periods
Gaussian$2.9 \times 10^{-3}$$6.8 \times 10^{-11}$
Exponential$0.28$$0.079$
Locally periodic$0.39$$0.023$

With $p = 9.24$ and $\ell = 2.70$, the Gaussian envelope drops to $e^{-\frac{p^2}{2\ell^2}} = e^{-5.85}$ over a single cycle, causing the forecast in the first figure to flatten out after one swing. By contrast, the exponential envelope retains 28% correlation after one period and 8% after two, sustaining oscillations deeper into the forecast.

Spectral line shape

The envelope equally determines the frequency spectrum of the cycle. By Bochner’s theorem, multiplying $\rho(\tau)$ by $\cos\frac{2\pi\tau}{p}$ shifts half the spectral density of $\rho$ to each frequency $\pm\frac{1}{p}$. A Gaussian envelope produces a Gaussian peak that falls away rapidly from $\frac{1}{p}$, whereas an exponential envelope induces a Lorentzian peak,

$$ \begin{aligned} S(\omega) &\propto \frac{\tau_e}{1 + (2\pi\tau_e\,\Delta)^2} , \\ \Delta &= \omega - \frac{1}{p} , \end{aligned} $$

whose tails decay algebraically as $\Delta^{-2}$. The 12-point BIC gain indicates that this series favors the broader Lorentzian tails over a sharp Gaussian line.

Related notes: Exponential kernel as an AR(1) process, Changepoint kernel with a tanh switch. Kernel validity rules appear in the µGauss reference, and a guided custom-kernel example appears in Using µGauss.