The pipeline
Four stages, each with its own checks before the next one is trusted.
1 · Forward curves and what the model infers from them
Each trading day gives one forward curve. Only a few maturities actually trade (the dots); the fitted model gives a full curve with uncertainty, including a model extrapolation beyond the contracts that exist. Drag the slider or press play.
2 · How the inferred dynamics move through time
Daily posterior for each parameter: the line is the median, the bands are 68% and 90% credible intervals. Click anywhere on the chart to jump the curve explorer to that day.
3 · Population level: do gold and Brent behave like different systems?
Layer 2 pools every day’s posterior into one population distribution per commodity (never mixing the two). Bars: where the individual days landed. Line: the hierarchical population-predictive distribution.
4 · Validation: can the inference be trusted?
Before touching market data, the pipeline is tested on synthetic curves whose true parameters are known.
Surrogate vs the analytic model
Calibration on simulated data (PP plots)
For each of 70 simulated curves with known parameters, where did the true value fall inside its own posterior? A calibrated method gives a diagonal line; the shaded band is the 95% envelope expected from only 70 injections.
5 · The real-market backtest, read honestly
Limits and next steps
What this is
- A working end-to-end Bayesian pipeline: simulation, surrogate, calibration, per-day inference, population inference, real data.
- A research-grade workflow: simulate, validate, calibrate, and only then fit real data, with each stage checked before the next is trusted.
- Reproducible on a cluster: one HTCondor job per day, with a DAG linking the layers.
What it is not (yet)
- The Schwartz–Smith forward curve has a closed form, so here the surrogate is a validated stand-in. Its real payoff is for products without one, such as options on futures priced by Monte Carlo, which is the natural next step.
- The observation noise in the real-data fits is a placeholder, so credible-interval widths are illustrative, not calibrated to market microstructure.
- The population is fitted per commodity on a single regime of roughly a year; there is no out-of-sample forecasting test yet.
- Not a trading system and not investment advice.
Data: futures prices fetched with yfinance; this page shows derived summaries only (quantiles, histograms, curves), not raw data. Stack: Python, PyTorch (MLP surrogate), nessai nested sampling, HTCondor.