tsbootstrap: Distribution-Free Uncertainty Quantification and Conformal Prediction for Time Series

By Sankalp Gilda

Rating

1934
Battle Count: 84

Relevance

7/10
Highly relevant for quantitative trading in several ways: (1) provides calibrated prediction intervals for return forecasts under dependence, critical for position sizing and risk management; (2) handles volatility clustering (ARCH) and regime shifts via adaptive conformal methods (ACI, NexCP, AgACI); (3) the streaming reduce enables real-time uncertainty quantification without memory explosion; (4) dependence-aware bootstrap corrects the severe undercoverage of IID methods on financial time series (27.8% vs 90% nominal for AR(1) phi=0.9); (5) however, it is a general-purpose UQ library rather than a trading-specific tool, and does not directly address portfolio optimization or execution.

Implementation Complexity

5/10
Moderate complexity: single typed API with specification objects simplifies usage (diagnose -> bootstrap -> conf_int), narwhals layer handles multiple dataframe backends, and the recommender auto-selects block lengths. However, the breadth of methods (5+ block types, residual/sieve/wild bootstraps, 4+ conformal calibrators, multiple interval types) requires understanding of when each is appropriate. Optional numba backend adds a compilation step. Five core dependencies (numpy, scipy, pydantic, scikit-base, narwhals) plus optional extras (statsmodels, scikit-learn, numba).

Reproducibility

5/5
MIT licensed, deterministic per backend for fixed seed (per-replicate PCG64 streams via SeedSequence), bit-for-bit reproducible for numpy backend, 93% test coverage with 80% per-file CI gate, GitHub Actions CI across 12-cell matrix (Python 3.10-3.13, Linux/macOS/Windows), nightly mutation ratchet (~1,100 mutants), Zenodo DOI (10.5281/zenodo.8226495), PyPI v0.6.1, 14 CI-executed notebooks, companion methods manuscript (arXiv:2404.15227). Benchmarks pinned to specific commits and versions.

About this paper

Methodology: tsbootstrap: Dependence-Aware Bootstrap Resampling with Adaptive Conformal Calibration. Problem types: Uncertainty Quantification, Time Series Forecasting, Distribution-Free Inference, Risk Management, Conformal Prediction.

The interactive Everscope explorer (charts, battles, favorites) loads below.