Frequency Uncertainty as Bandwidth: Calibrated Spectral Kernels with a Closed-Form Inner Loop

Kernels that can extrapolate repeating patterns are prized because they keep predicting seasonal or oscillatory structure far past the last observation. A spectral mixture kernel (a Gaussian-process covariance built from a learned set of frequencies, each with a bandwidth and a weight) does exactly this. The cost is that when a model sees only a handful of points from a new series, it cannot know any frequency exactly. A small frequency error turns into a phase error that grows linearly with how far ahead one predicts. Standard spectral-kernel models ignore this. They plug in a single frequency estimate, so their error bars stay narrow at long horizons while the prediction drifts out of phase. The result is confident and wrong, and it gets worse the farther out one looks.

This note proposes to fix that inside the adaptation step rather than after it. Averaging a cosine over a Gaussian distribution of frequencies, with variance $v$, produces the same cosine multiplied by a Gaussian envelope. Mathematically that is identical to widening the component's spectral bandwidth by $v$. So each component's frequency can be adapted to a new task with a single closed-form Newton step, and its frequency uncertainty can be read off the curvature of the task's likelihood, which is also closed form. That uncertainty is then folded back into the kernel as extra bandwidth. Predictive variance then widens with horizon in a way that is specific to each task, the computation stays analytical and differentiable end to end, and no post-hoc calibration layer is needed.

Core Claim

In few-shot extrapolation with spectral mixture kernels, most miscalibration at long horizons comes from frequency uncertainty that the kernel discards. That uncertainty can be propagated exactly through the covariance in closed form. Define a meta-learned bank of $Q$ components with weights $w_q$, frequencies $\mu_q$ and spectral variances $\Sigma_q$, as in the spectral mixture kernel. Given a task's support set, we compute an adapted frequency $\hat\mu_q$ and a frequency posterior variance $v_q$. We then use the kernel

$$k_{\text{task}}(\tau) = \sum_{q=1}^{Q} w_q \exp\!\big(-2\pi^2 \tau^2 (\Sigma_q + v_q)\big)\cos(2\pi \tau \hat\mu_q),$$

where $\tau$ is the input separation. This is exactly the expected covariance when the frequency is drawn from $\mathcal{N}(\hat\mu_q, v_q)$. It is therefore a second-moment-matched Gaussian approximation to the process with uncertain frequency, not an arbitrary widening. Classical frequency-estimation bounds say $v_q$ shrinks roughly as $1/(N\,T^2\,\mathrm{SNR})$ for $N$ points spanning a window $T$ at signal-to-noise ratio SNR. This gives a falsifiable prediction: the coherence length of each component in adapted tasks should scale as $T\sqrt{N\,\mathrm{SNR}}$, and interval coverage should stay flat across horizons, where fixed-frequency models lose coverage.

The adaptation step for each component is

$$\hat\mu_q = \mu_q - \frac{g_q}{h_q}, \qquad v_q = \frac{1}{\max(-h_q,\ \epsilon) + \rho_q},$$

where $g_q$ and $h_q$ are the first and second derivatives of the task's GP log marginal likelihood with respect to $\mu_q$, evaluated at the meta-learned value. The term $\rho_q$ is a meta-learned prior precision on frequency shifts, and $\epsilon$ is a small floor that guards against non-concave curvature. Both derivatives are analytic matrix expressions in the support Gram matrix. The whole inner loop is therefore one Cholesky factorization plus derivative traces, and the outer loop backpropagates through it.

Positioning Against Prior Work

The method draws on three existing pieces.

DKT is the closest prior work. It already uses a spectral kernel inside a closed-form inner loop, and on its out-of-range sine benchmark it reports MSE 0.10 against MAML's 8.45. However, its spectral hyperparameters are shared globally across tasks and trained by marginal likelihood. Every task therefore gets the same frequencies, and nothing accounts for frequency uncertainty. Our proposal keeps DKT's inner loop and adds task-specific frequency adaptation and uncertainty propagation, both in closed form.

Three works motivate the gap without filling it.

  • Iwata & Kumagai (journal version) show that deep-kernel GPs are miscalibrated in few-shot regression. They repair this with a learned Gaussian-mixture CDF warp trained on calibration error, reporting about 20% lower calibration error on the AHM climate data, but only with RBF kernels. Their warp is post-hoc and does not know about horizon or phase. We treat it as the main competitor rather than a component.
  • IKML meta-learns a distribution over spectral frequencies with a closed-form kernel ridge solver. It reaches RMSE 19.14 on Beijing Air Quality, but it produces point predictions only and samples frequencies through random features. We compute the covariance exactly and produce a predictive distribution.
  • DeepTime uses fixed Fourier features with a ridge head and is deterministic.

The Generalized Spectral Mixture and harmonizable mixture kernels make spectra depend on the input. That is a different axis: they model non-stationarity, whereas we model epistemic uncertainty about a stationary spectrum.

Two results constrain the design.

  • The file reports that spectral mixture likelihoods have many poor local optima and that many free spectral parameters overfit tiny data by synthesizing narrow spurious harmonics. This rules out per-task gradient fitting of all parameters from scratch. It is why we take only one local Newton step around a meta-learned bank, regularized by $\rho_q$.
  • ALAS shows that Gaussian spectral tails fail on rough functions. Our method inherits this limitation, and we say so.

Research Program

We will build the model for inputs where frequency has physical meaning: time indices and low-dimensional spatial coordinates, optionally with exogenous covariates entering through an additive RBF deep-kernel term. We do not claim that the frequency-uncertainty argument transfers to frequencies in a learned high-dimensional feature space, and we will not test it there.

Meta-training proceeds in four steps. First, the bank $\{w_q, \mu_q, \Sigma_q, \rho_q\}$ is initialized from pooled periodograms of the training tasks. Second, for each task we compute the adapted kernel on the support set. Third, the outer loop minimizes query negative log-likelihood. Fourth, a variant adds the differentiable calibration loss of Iwata & Kumagai, so that we can tell whether structural calibration and loss-based calibration add up or substitute for each other. Weights $w_q$ will also be re-estimated per task, by a closed-form non-negative projection onto the support Gram matrix, so that components unsupported by a task can switch off.

The analysis component checks three things on synthetic tasks where the truth is known:

  • whether $v_q$ tracks the actual squared frequency error;
  • whether the predicted $1/(N T^2 \mathrm{SNR})$ scaling holds;
  • where the approximation breaks. We expect breakdown when the likelihood in $\mu_q$ is multimodal, for example under aliasing from irregular sampling. There the Laplace step is wrong, and we will measure how often this happens.

Baselines

The naive reference point is DKT with a fixed RBF deep kernel trained by marginal likelihood (Patacchiola et al.). It shows how much extrapolation is lost without spectral structure.

The strongest existing spectral competitor is DKT with its shared spectral mixture kernel. On the out-of-range periodic benchmark it reports MSE 0.10. Beating it means matching that MSE within noise while achieving clearly better interval coverage and negative log-likelihood at the far horizons. No calibration number for DKT on this benchmark was found on Lacuna, so we will measure one ourselves.

The strongest existing calibration competitor is the Iwata & Kumagai meta-calibrated GP, run two ways:

  • in its original RBF form;
  • on top of DKT's spectral kernel, giving its warp the extrapolation horizon as an extra input so that it can, in principle, learn horizon-dependent widening.

The only reported figure is the roughly 20% ECE reduction on AHM over uncalibrated baselines; no absolute ECE values were found on Lacuna. Beating it means lower horizon-stratified calibration error at the longest horizon bucket, without worse MSE.

We will also run IKML, with RMSE 19.14 on Beijing Air Quality, as the accuracy reference for closed-form spectral meta-learning. Since it produces no predictive distribution, it competes on RMSE only.

All methods share the same backbone where one exists, the same meta-training tasks, the same support sizes, and the same hyperparameter search budget, measured as an equal number of configurations on a common validation split. Wall-clock time per adaptation will be reported.

Two ablations isolate the key ingredient:

  • Newton step without inflation ($v_q = 0$). This shows whether calibration comes from propagating uncertainty or merely from better frequencies.
  • Global inflation. A single meta-learned $v_q$ shared across tasks, which isolates the value of task-specific curvature.

Why not just…?

Why not just put the Iwata & Kumagai calibration warp on top of DKT's spectral kernel? This is the real threat, especially once the warp is given the horizon as input. The warp can learn a mean widening per horizon, but it cannot know that one task's frequency is well pinned down and another's is not. Its widening is the same for every task at a given horizon. Our inflation depends on each task's support size, time span and noise. The decisive test stratifies calibration error by both horizon and support size. If the horizon-aware warp matches us across those strata, the structural mechanism adds nothing beyond interpretability, and we will report that.

Why not just fit the spectral parameters per task by multi-restart gradient descent on the marginal likelihood? That is the standard non-meta approach, and it gives point estimates with no frequency uncertainty unless one adds the same Laplace step. It is also exposed to the local-optima and spurious-harmonic overfitting documented for spectral mixtures. We will run it with periodogram initialization and the same compute budget per task as our method, plus a variant given ten times that budget. We expect its calibration to suffer at small $N$; whether it ends up more accurate at large $N$ is an open empirical question.

Why not just use a fixed horizon-dependent variance multiplier, or an ensemble of spectral GPs? The global-inflation ablation is exactly the first option, so the experiments test it directly. An ensemble of independently trained spectral models captures some frequency spread. However, it costs a multiple of the compute, and its spread reflects variation between training runs rather than the information in each task. We include a five-member ensemble of DKT spectral models as a cost-matched-at-training reference.

Proposed Experiments

The first test uses DKT's out-of-range periodic regression benchmark. We extend it to vary support size and extrapolation distance, and we report MSE, Gaussian negative log-likelihood, 90% interval coverage, and calibration error bucketed by horizon. It is decisive because the truth is a pure sinusoid. Here our method should keep coverage near nominal across horizons while fixed-frequency DKT's coverage falls with horizon. If that does not happen on this clean case, the core claim is wrong.

Second, we build few-shot forecasting tasks from windows of the long-horizon forecasting series used by DeepTime: ETT, ECL, Traffic and Weather, whose daily and weekly cycles suit the method. Each window is one task: a short context and a long forecast. On these tasks we compare horizon-stratified calibration error and MSE. No per-dataset numbers for DeepTime were found on Lacuna, so all methods are rerun under one protocol.

Third, Beijing Air Quality tests accuracy against IKML's 19.14 RMSE and adds calibration that IKML cannot provide.

Fourth, AHM, MAT, School, Tafeng and Sales from Iwata & Kumagai test whether the method stays competitive on their own turf, where periodic structure is weaker. A tie there would still be acceptable; a clear loss would bound the method's scope.

A final check uses the Airline and Mauna Loa series, where the spectral mixture kernel reported MSE 460 against the rational quadratic kernel's 4200 on Airline. Treating sub-windows as tasks, we test whether inflated intervals still contain the truth over long extrapolations. The diagnostic we expect to separate the methods is the gap in coverage at the longest horizon combined with the measured correlation between $v_q$ and realized frequency error.