Quantitative-finance formula library for the CBMAS ORB commodity trading pipeline. 40 formula groups across 9 clusters, verified against textbook and canonical published values.
| Package | Highlight |
|---|---|
optimization | SGD, softmax, activations |
microstructure | FVG + CE, OFI, Hill β̂, Sato-Kanazawa √Q |
mean_reversion | OU + half-life, ADF gate, Johansen |
trend_following | Wonham + HJB, Markov, Hurst router |
risk_sizing | Kelly, EV gate, CVaR LP, Robust CVaR |
derivatives | Put-call parity, cost of carry |
statistics | Bin/Pois/Normal + 9 extended distributions |
foundations | Bayes, Black-Scholes, Sharpe/CAPM, VaR |
Closes a +34% under-estimation gap on canonical commodity β̂=4 tail-index values relative to Normal-scenario CVaR. One-line drop-in for any portfolio_optimizer.py that currently uses np.random.multivariate_normal for scenario generation.
Wonham filter for regime-probability tracking + Beta-Bernoulli conjugate for π refinement + EV gate for entry authorization. Together these form an auditable Bayesian trade-authorization pipeline where every π update is a single log line, every entry is a π-conditioned EV check, and every exit is a probability-threshold crossing.