Conformal Finance
Distribution-free uncertainty quantification for financial time series.
Mission: Replace meaningless RMSE metrics with calibrated prediction intervals that maintain valid coverage even when financial regimes shift.
Finance ML usually reports point forecasts. Point forecasts hide tail risk. Conformal prediction gives non-parametric, finite-sample coverage guarantees — but almost no public code targets non-stationary financial data. ConformalFinance does exactly that.
What you can do with it
- Wrap any point forecast in valid prediction intervals using split, CQR, or rolling conformal prediction.
- Adapt to distribution shift online with adaptive conformal inference (ACI).
- Forecast returns, realized volatility, and VaR with calibrated intervals.
- Diagnose empirical coverage, interval width, and conditional coverage by regime.
- Load real market data (optional
yfinance) or realistic synthetic AR/GARCH series. - Visualize coverage and width traces (optional
matplotlib/plotly).
Install
pip install conformal-finance
For development, docs, and optional data / plotting support:
pip install -e ".[dev]"
Quickstart
import pandas as pd
from conformal_finance.conformal.split import SplitConformalPredictor
from conformal_finance.data.synthetic import generate_ar_garch_returns
# Realistic synthetic returns
returns = generate_ar_garch_returns(n=2000, seed=42)
# Build a trivial point forecast: yesterday's return
y_true = returns.iloc[1:].reset_index(drop=True)
y_pred = returns.iloc[:-1].reset_index(drop=True)
# Split conformal intervals
cp = SplitConformalPredictor(alpha=0.1)
cp.fit(y_true_cal=y_true.iloc[:500], y_pred_cal=y_pred.iloc[:500])
intervals = cp.predict(y_pred_test=y_pred.iloc[500:])
print(intervals.head())
Design
- Core conformal methods are implemented from scratch so the API stays stable and lightweight.
- Optional extras (
yfinance,matplotlib,plotly) are imported lazily and never required for import. - scikit-learn-style interface: every predictor exposes
.fit()/.predict()or equivalent streaming methods. - Type hints and numpy/pandas idioms throughout.
Project layout
conformal_finance/
├── conformal/ # Split, CQR, ACI, Rolling conformal predictors
├── finance/ # Returns, volatility, VaR conformalizers
├── diagnostics/ # Coverage, width, and regime diagnostics
├── data/ # Synthetic AR/GARCH generators and yfinance loader
└── viz/ # Coverage/width plotting helpers
Documentation
Full docs are built with MkDocs and hosted at https://satyamdas03.github.io/conformal-finance/.
Local build:
mkdocs serve
Roadmap
| Version | Focus | Status |
|---|---|---|
| v0.1.0 | Split, CQR, ACI, rolling; returns, vol, VaR; diagnostics | In progress |
| v0.2.0 | Realized ES, drawdown, and factor-return targets | Planned |
| v0.3.0 | GARCH / historical-simulation benchmarks | Planned |
| v0.4.0 | Portfolio sizing and vol targeting | Planned |
| v0.5.0 | Research note + integration with FactorForge | Planned |
License
MIT © 2026 Satyam Das
Release files for conformal-finance 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| conformal_finance-0.1.1.tar.gz | 22.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| conformal_finance-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 49.2 kB
Release files / conformal_finance-0.1.1.tar.gz
| Download URL | conformal_finance-0.1.1.tar.gz |
|---|---|
| Size | 22.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
145b495d0eb1e53fa8a9e546629b79b63bad979c1cc455a0fb431eaa54c1db41
|
|
BLAKE2b-256 checksum How to use checksums |
9a955414954c4b1c6ced10c543761100c5f036ea3163a78949c64ca4ddd3d91e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|
Release files / conformal_finance-0.1.1-py3-none-any.whl
| Download URL | conformal_finance-0.1.1-py3-none-any.whl |
|---|---|
| Size | 26.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
93a904e3638224328f48489d5a72b5e817ae89f5aea14c3c2f3017383b8a863d
|
|
BLAKE2b-256 checksum How to use checksums |
a8c61c41ecfd5073f18b1a830b4c873a99834ff9d7de7b80413aed0bf730f3a4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|