The sandwich
Run any model in laplace's coordinates, map back exactly. Forecasters converge to laplace plus whatever they see that it missed; detectors that want stationary input improve, template matchers do not. Discuss.
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; historical) | 226 series, July pre-registration; superseded protocol | −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). These studies use different universes and protocols; the July PYMC-Forecast row records the figures previously reported, not a current whole-universe improvement claim.
PYMC-Forecast: current canonical result
Under the canonical protocol, laplace@PyMC has negative
median paired Δ log-likelihood against plain laplace on each
economic stratum: −0.0522 daily (500 series),
−0.0124 weekly (499), and −0.0153 monthly (471).
Positive would mean better than laplace. These are the committed
canonical summary
results also reported on the sidecar page.
The general claim that the PyMC sandwich edges laplace is withdrawn.
The July 226-series study remains available on the
historical bout page.
It reported its block-refit sand arm ahead on 65% of series,
with +0.04 nats median. Its separate frozen solo arm,
fit once before the 150-step test window, was reported with a +0.005-nat median
gap. These are distinct arms, not two summaries of one fit.
The canonical adapter refits and emits predictive distributions
through the common density reconstruction and scoring protocol;
the old results therefore do not establish a canonical gain or
that batch-refit staleness is negligible. The historical pooling
contrast is retained on the bout page and was not rerun here.
The older seasonal study (benchmarks/pymc_arms_study.py)
used the frozen z-space fit and reported positive sign-comparison
rates of 55% weekly, 64% monthly, and 84% on M4-Hourly, with median
lifts +0.009, +0.017, and +0.063 nats. Those are historical results
under a different protocol; the canonical weekly and monthly
medians above are negative. The canonical rerun did not cover
M4-Hourly, so it neither confirms nor retracts that older hourly
result. Sign-comparison percentages must not be confused with the
canonical HAC/DM win/draw/loss rule.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 compared models 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.