The sandwich
Run any model in laplace's coordinates, map back exactly. Everyone improves.
pip
install prophet-laplace.
laplace defines a causal bijection on paths: the Rosenblatt transform of each observation under the predictive issued for it. Feed the resulting z stream to any model, map its output back through the exact Jacobian, and the model operates on a stationarised, unit-scale stream instead of raw data. No retraining, no approximation in the accounting. The skill has the recipe; prophet-laplace is the drop-in package for Prophet.
Forecasters, one-step log-likelihood vs plain laplace
| model | universe | raw | sandwiched |
|---|---|---|---|
| ETS | FRED-30 | −2.03 | +0.01 |
| AutoARIMA | FRED-30 | −2.03 | +0.05 |
| GARCH(1,1) | FRED-30 | −1.94 | +0.03 |
| Prophet | FRED-30 | −2.04 | +0.03 |
| Prophet | 921 series, pre-registered | −0.76 (−4.6 family-weighted) | −0.02 |
| TabFM (regressor) | 226 series | −0.75 | −0.02 |
| TabFM (x100 classifier) | 921 series, pre-registered | −0.15 | +0.87 family-weighted; +1.99 on repeat-heavy series |
| PYMC-Forecast (Student-t lag regression, ADVI) | 226 series, pre-registered | −0.45 | +0.04; +2.1 on repeat-heavy series |
Numbers are median nats per observation relative to laplace alone (FRED-30 rows are means relative to laplace's 3.674). The pattern: raw models trail by whole nats; sandwiched, they converge to laplace plus or minus a small epsilon, and the epsilon measures conditional structure laplace missed. The large positive epsilons sit on repeat-heavy series, first found by the discrete TabFM head and confirmed by the PYMC-Forecast bout; that structure is a standing library work item.
The PYMC-Forecast row is the first sandwiched challenger whose positive epsilon spans the whole universe rather than one stratum: ahead of laplace on 65% of series, +0.04 nats median, filed as its pre-registered convergence hypothesis. The z stream also suits Bayesian machinery unusually well. Its marginal is N(0,1) by construction, so priors centred at no structure and unit scale are exactly right rather than guesswork, and a single pre-test ADVI fit frozen through all 150 test steps still ties laplace to the third decimal: in these coordinates, batch-refit staleness costs almost nothing. One pooled hierarchical fit across all 226 series lost to the same model fit per series on 72% of them, with the gains concentrated on the repeat-heavy stratum (+2.1 nats median); the full tape is on the bout page.
That convergence is not a daily-universe artifact. The same frozen
z-space fit, carried onto the seasonal and waveform arms, pulls
ahead of plain laplace rather than merely tying it: it wins 55%
of the weekly series, 64% of the monthly, and 84% of the M4-Hourly
waveforms, a small median lift (+0.009, +0.017, +0.063 nats) that grows
with periodic structure and peaks on the near-deterministic hard
waveforms. Those residual streams still carry conditional structure the
lag regression reads back, most of all where the signal is a repeating
shape (see benchmarks/pymc_arms_study.py). Standalone on the
raw series it stays a genuine underdog, losing to laplace on four of five
regimes (the challengers
radar); the lift is the sandwich, not the
model.1
Detectors
| detector | measure | raw | sandwiched |
|---|---|---|---|
| DSPOT (EVT thresholding) | UCR accuracy, 250 series | 0.120 | 0.232 |
| DSPOT | alarm rate at nominal 1e-3 (FRED, median) | 2.3e-3 | 2.5e-3, and best-in-table deep-tail behavior |
| RRCF (random cut forest) | UCR accuracy | 0.244 | 0.236 (a wash; carries its own normalizer) |
| left-discord matrix profile | UCR accuracy, 150 series | 0.587 | 0.427 (hurt; z whitens its templates) |
The detector rows locate the boundary: the sandwich lifts methods whose theorems want a stationary, calibrated input, does little for weak structural methods, and hurts template matchers. It transfers the forecaster's competence, in both directions.
Full protocols, statements filed before results, and every table's
source: the challengers page, the
paper's sandwich section, and
benchmarks/anomaly/RESULTS.md in the repository.
1 Both are flexible toolkits, not single models: skaters composes transforms, leaves, and ensembles, while PyMC-Forecast lets you specify arbitrary probabilistic models subject to Bayesian updating. These initial benchmarks use only each package's default settings for both. Submissions of other models and combinations are very welcome; open a pull request or an issue.