Prophet in a laplace sandwich: same API, calibrated densities
Project description
prophet-laplace
"He's not the messiah. He's a very naughty boy." (why) This package makes him useful anyway.
Prophet in a laplace sandwich: same API, calibrated densities.
from prophet_laplace import SandwichedProphet
m = SandwichedProphet(k=30) # accepts Prophet's kwargs too
m.fit(df) # ds, y (+ regressors as usual)
fc = m.predict(future) # yhat / yhat_lower / yhat_upper,
# mapped back exactly
What it does
SandwichedProphet fits Prophet in the z-coordinates of a
skaters laplace forecaster
(the Rosenblatt transform of each observation under the predictive issued
for it) and maps every forecast back through the exact inverse. Prophet
keeps its calendar decomposition, holidays, and extra regressors; the
sandwich supplies the volatility clock, repeated-value handling, and
tails whose stated probabilities come true.
Why
Measured on 921 non-price FRED series under a pre-registered protocol (statements, frozen universe, and results in the skaters repository):
| median one-step LL vs laplace | family-weighted (120 families) | |
|---|---|---|
| Prophet raw | -0.755 nats | -4.60 nats |
| Prophet sandwiched | -0.020 nats | -0.025 nats |
The sandwich closes 97% of Prophet's density gap without retraining
anything. predictive(step, z_mu, z_sigma) exposes the full y-space
density (logpdf, cdf, quantile) for scoring and risk use.
The same construction lifts other forecasters and detectors too: skaters.microprediction.org/sandwich.html.
Status
v0: future frames only, horizons past k reuse the k-step transport
(disclosed approximation). The goal is to demonstrate interoperability,
then propose the option upstream.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file prophet_laplace-0.0.1.tar.gz.
File metadata
- Download URL: prophet_laplace-0.0.1.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
25807e30fdfe7c0760a29159cc3f7a58cf3b305bc9accc709eeda081b47d33ae
|
|
| MD5 |
bdc87bb842847e7df87d03e478464c03
|
|
| BLAKE2b-256 |
5e0c09c21690a22ece38d4ea62eb612205c5e57ae9bbe59ad6c47c0a348d21f8
|
File details
Details for the file prophet_laplace-0.0.1-py3-none-any.whl.
File metadata
- Download URL: prophet_laplace-0.0.1-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b0bc25f6a7487651294917e2cdd54b54cf844494c74e3e4dcc3f16a88a735a1b
|
|
| MD5 |
34ba38fb105b61123db8186abc9dd65d
|
|
| BLAKE2b-256 |
778c31801184bbe16792f3666145b88d7a8ec681c3afe3d0687394da60ad33c8
|