Quantitative Research · Portfolio Project

Latent Liquidity &
Systemic Risk Dashboard

Bayesian state-space model inferring latent market stress from daily microstructure data. Two particle filter architectures — an adaptive Differentiable PF with Sinkhorn OT resampling and a fixed-parameter Bootstrap PF — are compared across filtering quality and 30-day early-warning performance.

DPF · Sinkhorn OT Bootstrap PF SVL + DRD Covariance Crisis Early Warning 9 Historical Episodes
DPF Endo. Episode AUC
0.567
vs BPF 0.500 ▲
DPF Daily ROC-AUC
0.682
vs BPF 0.670 ▲
DPF Crisis/Calm Ratio
340×
GFC 0.78 · calm 0.002
Warning Lead Time
47–60d
5 of 9 episodes detected
Training Sample
4,526
trading days · 2007–2026
◉ DPF — Differentiable Particle Filter
Architecture Sinkhorn OT resampling (ε=0.5)
Parameters Online gradient (Adam, η=5e-4)
Particles N = 500
Brier Score 0.212 ✓
Endo. Episode AUC 0.567 ✓
Signal-to-noise 2.67 ✓
◎ BPF — Bootstrap Particle Filter
Architecture Multinomial resampling
Parameters Fixed (hand-calibrated)
Particles N = 1000
Posterior CI width 0.219 ✓
Tail prob. AUC 0.726 ✓
Mean lead time 50.2d ✓

Interactive Time Window

Select an era or custom range
Loading data…

60-day Forward Crisis Probability

Logistic early-warning layer · dashed = 0.50 threshold
Rendering…

Latent Liquidity Stress Lt with 90% CI

Threshold L=2 · bar = tail prob P(L>2)
Rendering…

Latent Factors ht (log-vol) and zt (correlation driver)

DPF posterior means
Rendering…

Key Output Figures

Click to enlarge · see results page for full comparison

Reproduce Results

Full results page →
bash:
$ pip install -r requirements.txt
$ python main.py run # full pipeline: train → predict → calibrate → predict → bench
# Or run individual steps:
$ python main.py train # learn DPF parameters (rolling 120d windows)
$ python main.py predict --filter dpf # DPF filter + forward simulation
$ python main.py calibrate --filter dpf # fit logistic warning model
$ python main.py bench # DPF vs BPF comparison + all figures
$ python main.py animate --start 2007-06-01 --end 2009-06-01 # animated GIF