Skip to main content

Research notebooks & Python library

Quantitative Finance Lab

24 projects in quantitative finance, from mathematical foundations
to reproducible experiments and reusable Python.

Choose a research track.

Five starting points. A shared set of questions, methods and tools.
Choose a track to see the projects inside.

How the projects connect.

Follow a track from left to right, or cross over when an idea connects.
A suggested reading route, rather than a list of prerequisites.

Related methods

The project collection.

All 24 notebooks, in their original order.
Open a project outline to see the methods and experiments inside.

24 projects

1. Fixed Income and Yield Curve Construction

  • Bootstrap US and Japan Treasury curves from par yields into discount, zero-rate, and forward-rate curves
  • Price fixed-coupon bonds and rolling synthetic bond issuance from curve inputs
  • Measure duration, convexity, PV01, and key-rate duration exposures
  • Build duration-targeted bond portfolios with reusable fixed-income utilities

Open Project 01

2. Portfolio Optimization with Mean-Variance Models

  • Select a liquid Nasdaq stock universe with realistic history and liquidity filters
  • Estimate expected returns with momentum, Bayes-Stein shrinkage, and Bayes-Stein momentum
  • Compare sample, Ledoit-Wolf, OAS, and EWMA covariance estimators inside constrained optimizers
  • Backtest min-variance, mean-variance, and max-Sharpe portfolios with turnover, drawdown, and risk diagnostics

Open Project 02

3. Risk Analysis and CAPM

  • Build a reusable risk report for assets, strategies, and portfolios
  • Compute performance, distribution shape, drawdowns, VaR, expected shortfall, and stress windows
  • Estimate CAPM alpha, beta, rolling exposure, and benchmark-relative behavior
  • Add risk contribution and diversification diagnostics reused across later projects

Open Project 03

4. Black-Scholes, Implied Volatility, Greeks and Hedging

  • Build option payoffs, risk-neutral pricing intuition, and the Black-Scholes-Merton model
  • Clean SPX option chains and invert implied volatility with robust solver diagnostics
  • Compute Greeks with analytic, autodiff, and finite-difference validation
  • Test delta and delta-vega hedging with P&L attribution, transaction costs, and a BTC options repeat

Open Project 04

5. Volatility Forecasting with GARCH and Variance Risk Premium

  • Forecast realized volatility with GARCH, GJR-GARCH, EGARCH, and HAR-RV models
  • Build a clean 30-day ATM implied-volatility panel from SPX option chains
  • Estimate the variance risk premium as an implied-versus-realized variance spread
  • Translate VRP signals into straddle overlays with performance, risk, and diagnostic checks

Open Project 05

6. Black-Litterman with Learned Confidence

  • Build ETF strategic benchmarks, covariance estimates, and market-implied priors
  • Encode active views and learn confidence from realized historical view payoff reliability
  • Convert Black-Litterman posterior returns into active weights with tracking-error controls
  • Evaluate active portfolios against benchmarks and repeat the workflow on sector ETFs through the library

Open Project 06

7. Dynamic Hedge Ratios and Residual Trading

  • Estimate static, rolling, ridge, and Kalman/state-space hedge ratios
  • Diagnose hedgeability across equity, commodity, currency, and ETF relationships
  • Measure hedged books with volatility, expected shortfall, drawdown, beta, turnover, and cost drag
  • Test residual spreads with ADF, Engle-Granger, half-life, z-score rules, no-trade bands, and robustness repeats

Open Project 07

8. Volatility Surface and Local Volatility

  • Construct a clean SPX option surface from forwards, rates, paired quotes, and bid-ask-aware IV
  • Fit raw PCHIP and smoother log-total-variance B-spline volatility surfaces
  • Derive Dupire local volatility with no-arbitrage, stress, and surface-quality diagnostics
  • Build historical surface features, PCA surface dynamics, surface-aware Greeks, and a BTC options repeat

Open Project 08

9. Term Structure Models, Curve Factors, and Swap-Based Duration Overlays

  • Reuse Treasury curve data to build monthly zero-rate panels, SOFR returns, and curve factors
  • Calibrate Vasicek, CIR, HW1F, and G2-style term-structure models with diagnostic checks
  • Decompose curve moves with PCA level, slope, and curvature factors plus term-premium proxies
  • Convert curve views into duration-ladder and fixed-for-floating swap overlay backtests

Open Project 09

10. Portfolio Optimization: Tail Risk, Risk Parity and Robust Models

  • Compare tail-risk, CVaR, risk-parity, HRP, robust, and Wasserstein-DRO portfolio objectives
  • Stress optimizer sensitivity to expected-return, covariance, and scenario assumptions
  • Study mean-variance, Black-Litterman, CVaR, ellipsoid-robust, and distributionally robust allocations
  • Evaluate drawdowns, costs, turnover, risk contributions, and secondary library replication

Open Project 10

11. Stochastic Volatility Models and Model-Risk-Aware Option Relative Value

  • Build a clean SPX option modeling panel from the earlier option-chain and IV stack
  • Fit SVI, SSVI, SABR, Merton, Heston, and Bates-style smile and stochastic-volatility models
  • Compare fit quality, residuals, weighted IV errors, runtime, parameter warnings, and model stability
  • Trade model-risk-aware option relative value with hedging attribution, controls, and secondary market repeats

Open Project 11

12. Macro Financial Conditions Index and Macro-Regime Allocation

  • Transform macro series into stress-oriented monthly features across inflation, policy, growth, labor, housing, trade, and breadth
  • Build economic-weighted, PCA, PLS, stress-probability, and blended financial-conditions indexes
  • Validate FCI signals against future equity stress, volatility, and drawdowns
  • Apply macro-regime signals to sector rotation and risk scaling with performance, drawdown, and library replication

Open Project 12

13. American Options and Numerical Pricing Methods

  • Price American options with Cox-Ross-Rubinstein trees, finite differences, PDE logic, and Longstaff-Schwartz Monte Carlo
  • Build a SPY American-option panel with dividends, rates, spreads, and early-exercise inputs
  • Study convergence, PSOR, exercise boundaries, assignment risk, and model disagreement
  • Compare Python, Numba, and C++ engines and repeat the workflow through reusable library tools

Open Project 13

14. Fourier-Based Methods for Option Pricing

  • Price options from characteristic functions instead of closed-form formulas, trees, or simulated paths
  • Implement direct Fourier integration, Carr-Madan FFT, and COS pricing methods
  • Compare BSM, Merton, Variance Gamma, Heston, and Bates pricing and calibration behavior
  • Diagnose SPX and BTC fit, convergence, runtime, jump risk, stochastic volatility, and reusable library implementation

Open Project 14

15. Factor Investing and Fama-French Allocation

  • Build Fama-French factor, sector ETF, industry portfolio, and broad ETF return panels
  • Estimate full-sample and rolling factor exposures for sectors and tradable ETFs
  • Convert factor states, residual alpha, and validation-weighted scores into allocation signals
  • Test factor-timing and sector-rotation portfolios with risk, turnover, drawdown, and library diagnostics

Open Project 15

16. Regime Switching Portfolio Selection

  • Build cross-asset, macro, FCI, breadth, volatility, drawdown, and correlation features
  • Define realized future regimes from forward risk-versus-defensive outcomes
  • Compare clustering, Markov-switching, hidden Markov, and supervised classification models
  • Convert regime probabilities into state-conditioned sleeves and repeat the workflow on sector ETFs

Open Project 16

17. Network-Aware Portfolio Construction

  • Turn a rolling NASDAQ stock universe into correlation and tail-dependence networks
  • Compare dense graphs with filtered MST and PMFG market structures
  • Measure centrality, clustering, graph roles, and dependence concentration
  • Use network scores as portfolio signals with diversification, turnover, and stress diagnostics

Open Project 17

18. Rough Volatility for Option Pricing

  • Estimate physical roughness from log realized variance and moment-scaling diagnostics
  • Compare rough-kernel variance forecasts with HAR and GARCH-style benchmarks
  • Study option-implied roughness through short-maturity skew power laws
  • Simulate and calibrate rBergomi and rough-Heston-style models for pricing, calibration, and hedge sensitivity

Open Project 18

19. Machine Learning and Neural Forecasting for Uncertainty-Aware Kelly Allocation

  • Build 21-day cross-asset forward alpha targets and date-asset feature panels
  • Train tabular, neural sequence, and probabilistic forecasting models
  • Evaluate rank IC, bucket spreads, pinball loss, coverage, calibration, and uncertainty diagnostics
  • Convert forecasts into fractional Kelly and forecast-gated MaxSharpe allocations with sector ETF transfer

Open Project 19

20. Reinforcement Learning for Portfolio Allocation

  • Build a weekly RL portfolio environment with costs, drawdown, volatility, prior weights, and market-state features
  • Define a continuous action-to-weight map that always produces valid long-only portfolio allocations
  • Train PPO, recurrent PPO, and SAC policies with a differential-Sharpe reward and risk penalties
  • Compare RL policies against forecast-gated, Kelly, and regime-aware baselines plus a sector ETF library transfer

Open Project 20

21. Fundamental Equity Research, Scoring and Reporting

  • Reconstruct quarterly and trailing statements from point-in-time SEC filings
  • Analyze profitability, cash quality, financial strength and valuation with company-type-specific diagnostics
  • Compare fixed and adaptive peer-relative scores, stock selections and portfolio allocations
  • Produce issuer reports and reproduce the historical S&P 500 workflow with library calls

Open Project 21

22. Corporate Credit Risk, Market Pricing and Structured Credit

  • Construct censored bankruptcy and distress targets from SEC filing histories
  • Compare logit, spline, LightGBM, direct-horizon and Merton risk estimates
  • Connect expected credit loss to market spreads, Fed EBP, FINRA activity and synthetic CDS
  • Simulate issuer portfolios, copula dependence, tranche losses and joint credit stresses

Open Project 22

23. Real-Time Macro and Monetary Policy Nowcasting

  • Build as-of information sets and first-release GDP, inflation and labor targets
  • Compare component bridges, grouped mixed-frequency factors, MIDAS, Minnesota BVAR and forecast combinations
  • Attribute Kalman news and evaluate professional forecasts and aligned overnight-rate distributions
  • Repeat the models on Canadian releases, Bank of Canada data and international inputs

Open Project 23

24. Building a financial analyst with LLM, Fine tuning and retrieval

  • Retrieve official releases and selected SEC disclosures with publication cutoffs
  • Combine financial changes, risk, rates and cross-asset context from the existing library
  • Run one cached Qwen3.5-2B GGUF locally with calibrated GPU offload
  • Produce readable, cited company, macro, event and daily analyses

Open Project 24

Built in notebooks.
Reusable in Python.

The experiments become tools. quantfinlab brings the reusable methods together in a typed, tested Python library — from curve construction and pricing to portfolios, credit, macro and financial analysis.

Read the library documentation
quantfinlab Python 3.11–3.12
$ pip install quantfinlab
fixed_incomeoptionsportfolioriskfundamentalscreditmacroanalyst
View on PyPI