Projects

22 projects from the WorldQuant MScFE. Most are group projects with equal contribution across all components.

LSTM Trading Strategy Across Multi-Asset ETFs

Building LSTM neural networks to predict and trade a five-asset ETF universe (equities, bonds, gold, oil), then backtesting the resulting strategy against a simple equal-weight buy-and-hold benchmark.

Python LSTM TensorFlow Backtesting
  • Individual LSTM models; built and trained a separate LSTM model for each of five ETFs (SPY for equities, TLT and SHY for long- and short-duration bonds, GLD for gold, DBO for oil), predicting next-period returns from historical price sequences.
  • Strategy construction & backtesting; converted model predictions into trading signals and backtested the resulting LSTM-based strategy against an equal-weight buy-and-hold benchmark, evaluating performance through cumulative returns, drawdowns, and return distributions.
  • Multi-output LSTM model; extended the approach to a single multi-output LSTM predicting all five ETFs jointly, testing whether modeling cross-asset relationships in one network improves on training independent models per asset.
Download the notebook

Data Leakage & Walk-Forward Backtesting of Deep Learning Trading Models

Shows how data leakage inflates the apparent performance of MLP, LSTM and CNN-GAF models on SPY, then re-tests them with leak-free walk-forward backtesting.

Python PyTorch NumPy Backtesting
  • Built a 5-day-ahead direction classifier on 2,000 days of SPY returns (10 lagged returns as features, chronological 70/30 split).
  • Leakage demonstration: labels built from a global return quantile and features normalized on the full sample; coded a check counting training samples whose labels overlap the test period.
  • Implemented an MLP, an LSTM (NumPy, gates and BPTT) and a CNN on Gramian Angular Field images of return windows.
  • Strategy backtest with long/short signals, 5-day non-overlapping trades and 5 bps costs; metrics: total/annualized return, volatility, Sharpe, max drawdown, hit rate versus buy-and-hold. On the leaky setup the MLP and CNN lost money while buy-and-hold had a Sharpe of 1.31.
  • Walk-forward validation (500/500 and 500/100 windows) with scaling and labels computed inside each fold; retrained MLP and CNN-GAF in PyTorch per fold. Leak-free accuracy of about 59-60% mostly reflected majority-class prediction (class-1 recall of 1-3%).
  • Takeaway: headline accuracy hides weak predictive power; only leak-free walk-forward tests with trading metrics give an honest picture.
Download the notebook

Exotic Option Pricing: Stochastic Volatility & Jump Diffusion

Pricing options under the Heston and Merton models via Monte Carlo simulation, extending to American early-exercise and barrier options; where theory meets the messiness of real option pricing.

Python Monte Carlo Heston Model Options Pricing
  • Heston model (stochastic volatility); simulated correlated stock price and variance processes via Monte Carlo (10,000 paths) to price at-the-money European calls and puts, testing sensitivity to the correlation parameter ρ between asset returns and volatility.
  • Merton jump-diffusion model; modeled sudden price jumps (Poisson-distributed) layered on top of standard diffusion, pricing options under varying jump intensities and comparing the resulting price curves against the Heston model's smoother, volatility-driven behavior.
  • Greeks estimation; computed Delta and Gamma numerically under both models to quantify option price sensitivity to the underlying asset.
  • American options & early exercise; priced an American call under the Heston model using Monte Carlo with Least Squares Regression (the Longstaff-Schwartz approach), confirming the early-exercise premium against the European price.
  • Barrier options; priced Up-and-In Call and Down-and-In Put exotic options under jump-diffusion, showing how barrier conditions can significantly discount an option relative to its vanilla European equivalent.
Download the notebook

Robust Portfolio Construction: Denoising, HRP & Purged Cross-Validation

Tests 8 portfolio-construction strategies on 10 US equities, combining covariance denoising, Hierarchical Risk Parity and Combinatorial Purged Cross-Validation (CPCV) to reduce overfitting.

Python Hierarchical Risk Parity CPCV Risk Management
  • Implemented from scratch covariance denoising, Hierarchical Risk Parity (hierarchical clustering of assets) and Combinatorial Purged Cross-Validation (many train/test combinations with purging and embargo to prevent leakage), on 10 US equities (Jan 2024 - Jun 2025).
  • Built 8 strategies combining these methods, with a 15%-capped Maximum Sharpe portfolio as baseline, and compared annual return, volatility, Sharpe, max drawdown, CVaR and weight stability.
  • Key findings: MSRP with CPCV ranked first (Sharpe 0.61 vs 0.25 for the baseline); HRP alone had the lowest drawdown (-14% vs -22%); denoising added little on its own; combining all three methods did not help.
  • Out-of-sample check on July 2025, a month not used to build either portfolio: the baseline did slightly better (Sharpe 8.1 vs 7.0), reported as it came out.
  • Discussed the prediction vs. interpretation trade-off between simple explainable portfolios and more complex, better-validated ones.
Download the notebook

Yield Curve & Market Risk Analysis

Modeling the U.S. Treasury yield curve and decomposing market risk through correlation analysis; from raw FRED data to a fitted Nelson-Siegel curve and PCA-driven factor decomposition.

Python Nelson-Siegel Model PCA/SVD
  • Yield curve modeling; pulled historical U.S. Treasury yield data via the FRED API and fitted a Nelson-Siegel curve to model the term structure at different points in time, comparing fitted curves against observed yields.
  • Correlation & dimensionality reduction; used PCA and SVD to decompose the covariance structure of Treasury-linked ETF returns, isolating the dominant factors driving yield movements and demonstrating how a small number of components explain most of the variance in rate changes.
  • Empirical ETF analysis; applied the same PCA/SVD framework to a real estate sector ETF (XLRE) and its top 30 holdings, extracting principal components from daily return covariance to understand the sector's underlying risk factors.
Download the notebook

Market Prediction & Credit Risk Analysis

Testing whether short-term technical signals predict emerging-market ETF returns, then shifting to credit risk; structuring and exploring a loan default dataset to surface the drivers of default.

Python scikit-learn Credit Risk
  • ETF return prediction; built a linear regression model using a 10-day simple moving average to predict next-day returns on the Chile country ETF (ECH), validated across 5-fold cross-validation. Results showed weak but consistent positive correlation between predicted and actual returns, illustrating how difficult short-horizon return prediction is even with a clean, simple setup.
  • Credit risk data analysis; cleaned and structured a consumer credit dataset (loan amount, interest rate, borrower income, employment length, credit history length, loan status), handling missing values and categorical encoding, then explored the distributions driving default risk as groundwork for credit risk modeling.

Financial Econometrics: Diagnosing Data Pathologies

A practical framework for spotting and fixing the four statistical issues that quietly break financial models; skewness, fat tails, outlier sensitivity, and non-stationarity; with diagnosis and remedies for each.

Python Statsmodels Time Series
  • Skewness; simulated and measured distributional asymmetry, and discussed its impact on risk models that assume normality.
  • Kurtosis & heteroscedasticity; examined fat-tailed distributions and time-varying volatility, both common in financial returns and both dangerous when ignored in options pricing and risk management.
  • Outlier sensitivity; used the modified Z-score (median absolute deviation) to detect and quantify the distortion outliers introduce into means, variances, and regression coefficients.
  • Non-stationarity & unit root testing; applied the Augmented Dickey-Fuller test to detect random-walk behavior in time series, and discussed why modeling non-stationary data without differencing produces spurious, unreliable results.
Download the notebook

Cointegration, Non-Stationarity & Multicollinearity in Financial Time Series

From feature engineering on time series to a full Johansen cointegration study of gold, silver, and platinum; building a VECM model and diagnosing multicollinearity across major tech stocks along the way.

Python VECM Cointegration Time Series
  • Feature extraction; engineered lag features, rolling statistics, and differencing on time series data to prepare it for modeling, and assessed which transformations actually preserve useful signal.
  • Non-stationarity & long-run equilibrium; tested gold, silver, and platinum prices (1985–2024) for unit roots using ADF and KPSS tests, confirmed a cointegrating relationship via the Johansen test, and built a Vector Error Correction Model (VECM) capturing the long-run equilibrium between the three metals; the same statistical foundation used in pairs trading, where cointegrated assets are traded against each other on the assumption their prices revert to equilibrium.
  • Multicollinearity; analyzed daily returns of AAPL, MSFT, GOOGL, and AMZN, using correlation matrices and Variance Inflation Factor (VIF) to detect and quantify redundancy between highly correlated tech stocks, identifying which pairs would destabilize a regression model.

Option Pricing: Binomial Trees & Put-Call Parity

Pricing European and American options with the Cox-Ross-Rubinstein binomial model, then stress-testing put-call parity across moneyness levels to see where the theory breaks down for early-exercise options.

Python Binomial Trees Options Pricing
  • Binomial tree pricing; implemented the Cox-Ross-Rubinstein (CRR) model with 100 time steps to price at-the-money European calls and puts, computing up/down factors and risk-neutral probabilities from volatility and the risk-free rate.
  • Moneyness sensitivity; priced calls and puts across a range of strikes (deep ITM to deep OTM) to confirm option values move as theory predicts: call prices fall as strikes rise, put prices rise as strikes rise.
  • Put-call parity testing; checked the parity relationship (C − P = S − PV(K)) across strikes for both European and American options, finding it held only at-the-money for European options and broke down elsewhere; and testing why American options systematically violate it due to early-exercise rights.
  • Multi-step binomial trees; extended the model to a 3-step tree pricing a put option, tracing asset price evolution node by node and discounting expected payoffs back to present value.
Download the notebook

Calibrating Stochastic Models to Real Market Data

Fitting the Heston, Bates, and CIR models to real option and interest-rate data; from stochastic volatility calibration via Fourier pricing to simulating a full year of interest-rate paths.

Python Heston Model Monte Carlo Calibration
  • Heston model calibration; calibrated the Heston stochastic volatility model to real 15-day equity option prices using Fourier-based pricing (the Lewis/Carr-Madan approach) and global optimization (differential evolution), converting puts to synthetic calls via put-call parity and verifying the Feller condition on the fitted parameters.
  • Bates model (Heston + jumps); extended the calibration to 60-day options using the Bates model, which layers a jump-diffusion component on top of stochastic volatility, to test whether adding jumps improves the fit to market prices.
  • CIR interest rate model; calibrated the Cox-Ingersoll-Ross model to the Euribor term structure (7 to 360 days), then simulated 100,000 one-year interest rate paths to estimate the expected 12-month Euribor rate and its 5th-95th percentile confidence range.

Regime-Switching Volatility: S&P 500 vs. Bitcoin

Detecting bull/bear volatility regimes in equities and crypto with Markov-switching models; comparing how a traditional index and a highly volatile digital asset behave across calm and turbulent periods.

Python Markov-Switching Models Time Series
  • Time series diagnostics; analyzed S&P 500 and Bitcoin daily returns (2019-2022) with rolling volatility, ACF/PACF plots, and Ljung-Box tests to characterize each series' autocorrelation structure before modeling.
  • Markov regime-switching models; fitted two-regime Markov-switching models to both assets to identify distinct low- and high-volatility states, visualizing regime shifts against real market events (the COVID crash and subsequent bull run, the 2022 bear market).
  • Model comparison; compared model variants with different mean and variance specifications using AIC/BIC, selecting the best-fitting specification for each asset.
  • Regime-switching autoregression; extended the model to a Markov-switching AR(1) process on S&P 500 returns, estimating smoothed regime probabilities over time to show how the probability of being in a high-volatility state evolves.
Download the notebook

Multi-Armed Bandits for Stock Selection: 2008 vs. 2020

Applying reinforcement learning (UCB and Epsilon-Greedy algorithms) to pick stocks during the 2008 financial crisis and the 2020 COVID crash; treating each stock as a bandit arm and letting the algorithm learn where to allocate.

Python Reinforcement Learning Multi-Armed Bandits
  • Data collection & correlation structure; gathered daily returns for 30 stocks (14 financial, 15 non-financial) during the September-October 2008 crisis, and used hierarchical clustering on the correlation matrix to visualize how stocks grouped together under stress.
  • UCB (Upper Confidence Bound) algorithm; implemented UCB from scratch to sequentially select stocks, balancing exploitation of historically strong performers against exploration of under-tested ones, using each stock's daily return as its "reward."
  • Epsilon-Greedy algorithm; implemented a second bandit strategy for comparison, choosing the best-known stock most of the time while randomly exploring alternatives a fraction of the time.
  • Out-of-sample stress test; reran both algorithms on the same 30 stocks during the March-April 2020 COVID crash, comparing cumulative returns between UCB and Epsilon-Greedy to see which strategy adapted better to a completely different crisis.
Download the notebook

Machine Learning Foundations for Finance: Clustering, PCA, and Trees

Three core ML techniques applied to financial data; clustering assets by behavior, reducing a 20-stock portfolio to its key risk factors, and predicting returns from momentum and volatility with a regression tree.

Python scikit-learn PCA Machine Learning
  • K-means clustering; implemented and visualized K-means step-by-step (centroid initialization, point assignment, centroid updates) on financial-style data with return and volatility features, illustrating how the algorithm groups similar instruments.
  • Principal Component Analysis (PCA); applied PCA to daily returns of 20 major stocks (AAPL, MSFT, GOOGL, TSLA, JPM, and others) to reduce the portfolio's dimensionality and identify the principal factors driving joint stock movements.
  • Regression trees; trained a decision tree regressor to predict asset returns from momentum, volatility, and value features, using a time-aware train/test split to respect the sequential nature of financial data and evaluating performance with MSE and R-squared.
Download the notebook

LDA, Neural Networks & SVMs for Financial Classification

Three classification techniques on real and financial data; using Linear Discriminant Analysis for dimensionality reduction, a neural network to predict S&P 500 returns, and SVMs across synthetic financial classification and regression tasks.

Python Neural Networks SVM scikit-learn
  • Linear Discriminant Analysis (LDA); applied LDA to the classic Iris dataset for supervised dimensionality reduction, then paired it with a Random Forest classifier to evaluate classification accuracy via a confusion matrix. Extended the technique to a synthetic financial-instrument classification task.
  • Neural networks; built a feedforward neural network (Keras/TensorFlow, with dropout regularization) to predict next-period S&P 500 returns from engineered features, using a time-respecting train/test split.
  • Support Vector Machines (SVMs); implemented both SVC and SVR on synthetic financial data (returns, volatility, volume, momentum) for classification and regression tasks, tuning hyperparameters via grid search and cross-validation.
Download the notebook

Model Tuning: Hyperparameter Optimization, Bias-Variance & Ensembles

Practical machine learning engineering for financial models; tuning a Random Forest via randomized search, diagnosing overfitting with learning curves, and comparing bagging, boosting, and stacking ensembles.

Python scikit-learn Ensemble Learning Hyperparameter Tuning
  • Hyperparameter optimization; tuned a Random Forest regressor on synthetic financial-factor data using randomized search with 5-fold cross-validation, comparing the optimized model's test performance against a baseline.
  • Bias-variance tradeoff; diagnosed underfitting and overfitting across four model types (regularized logistic regression, a deep decision tree, a shallow decision tree, and a Random Forest ensemble) using learning curves, visualizing how each model's training and validation accuracy diverge as more data is added.
  • Ensemble learning; implemented and compared three ensemble strategies (bagging, boosting, and stacking) on a classification task, evaluating each with cross-validation to see which combination method generalized best.
Download the notebook

Deep Learning for Price Prediction: MLPs vs. GAF-CNNs

Comparing neural network architectures for S&P 500 prediction across three data representations; testing whether converting price series into images (Gramian Angular Fields) for a CNN beats a standard neural network.

Python Deep Learning CNN TensorFlow
  • Stationarity analysis; tested S&P 500 price levels for stationarity via the Augmented Dickey-Fuller test, then applied fractional differencing to find the optimal balance between removing trend and preserving memory in the series (unlike simple log returns, which achieve stationarity but discard more information).
  • MLP baseline models; trained feedforward neural networks on three representations of the same data; raw price levels, log returns, and fractionally differenced series; using lagged values as features, to test which representation is easiest for a neural network to learn from.
  • GAF-CNN models; converted each time series into Gramian Angular Field images and trained convolutional neural networks on the resulting "pictures" of price dynamics, an unconventional but increasingly popular technique for financial time series.
  • Comprehensive model comparison; benchmarked all six model/representation combinations by MSE and MAE, finding that a standard MLP trained on log returns outperformed every CNN variant, including the image-based ones; a useful reminder that architectural sophistication doesn't always beat simpler, well-chosen representations.
Download the notebook

Mean-Variance Portfolio Optimization, Factor Analysis & Monte Carlo

Builds and tests constrained mean-variance portfolios on 10 US equities, then runs a Fama-French 5-factor regression and checks the optimizer against Monte Carlo simulation.

Python SciPy Statsmodels Fama-French
  • Downloaded two years of weekly prices (July 2023 - June 2025) for 10 large-cap US stocks across tech, banks, pharma, energy and retail.
  • Solved the Global Minimum Variance and Maximum Sharpe portfolios with SciPy (SLSQP, no short-selling); the Max Sharpe portfolio reached about 41.7% annualized return at 19% volatility (in-sample Sharpe of about 2.04).
  • Added a 15% maximum weight per asset and plotted the efficient frontier with and without the cap.
  • Out-of-sample test (July-September 2025) against a benchmark, reporting total return, Sharpe, max drawdown and win rate. Both portfolios beat the benchmark (18.8% and 16.4% vs 12.6%); the constrained portfolio had the better Sharpe ratio (5.75 vs 5.61) with lower volatility.
  • Fama-French 5-factor regression (OLS and robust Huber) of the portfolio's excess returns: positive significant alpha, no significant factor exposure, low explanatory power (R² of about 0.09).
  • Monte Carlo validation: an optimizer class comparing SLSQP with 50,000 random-portfolio simulations, with and without a weight cap. Variance matched within 0.15%, converging to within 0.04% at 100,000 simulations.
Download the notebook

Portfolio Strategies: MVO vs 1/N, Black-Litterman & Kelly Criterion

Compares portfolio construction methods on US equities: constrained mean-variance optimization, a 5,000-run simulation against equal weighting, Black-Litterman with investor views, and Kelly-criterion sizing.

Python SciPy Black-Litterman Monte Carlo
  • Optimized a 7-stock portfolio (AAPL, NVDA, TSLA, XOM, REGN, LLY, JPM) on weekly data for July 2023 - June 2025, comparing long-only, long-only with a 20% cap, and unconstrained short-selling; the 20% cap gave the best Sharpe ratio (0.131 weekly vs 0.099 and 0.098).
  • Simulated 5,000 random 5-stock portfolios from a 20-stock universe (2-year estimation, 1-year out-of-sample test). Equal weighting beat minimum-variance optimization on average (14.0% vs 11.6%, statistically significant by paired t-test); the optimized portfolio won in down markets (75% win rate) and lost in bull markets, behaving as a defensive strategy.
  • Black-Litterman: equilibrium returns from market-cap weights and a risk-aversion estimate, blended with 7 investor views (including relative views NVDA vs AAPL and REGN vs LLY) to get posterior returns and weights, compared with a market-weighted portfolio in and out of sample.
  • Kelly criterion: implemented full, half and double Kelly sizing, measuring Sharpe, volatility and drawdowns on train and test periods, and showing how leverage amplifies risk without improving the Sharpe ratio.
Download the notebook

Oil Price Drivers: Data Pipeline, Cleaning & Causal Network

Builds a multi-source data pipeline for oil-price risk factors, with a three-stage cleaning process, exploratory analysis and a Bayesian-network diagram of the drivers.

Python Pandas Data Cleaning Bayesian Network
  • Collected oil price (WTI), S&P 500, USD index, VIX, energy-sector ETFs, US GDP, industrial production and CPI from Yahoo Finance and FRED, and merged them into one time-series dataset.
  • Three-stage cleaning: winsorized extreme outliers at 4 standard deviations; removed duplicate timestamps, impossible negative values and jumps above 5 standard deviations; imputed missing values by variable type (fill-forward for market prices, time-based interpolation for macro series).
  • Exploratory analysis: distributions, time series, correlation heatmap, scatter matrix and scatter plots against the oil price.
  • Drew a Bayesian-network diagram of the main oil-price drivers (supply, USD, VIX) and their effect on energy equities (XLE, XOP, USO), as a base for later risk modelling.
Download the notebook

Oil Market Regimes: Hidden Markov Model on WTI Crude

Detects bull, bear and stagnant regimes in WTI crude oil returns with a 3-state Gaussian Hidden Markov Model, and explores Bayesian-network structure learning.

Python Hidden Markov Model hmmlearn Bayesian Network
  • Downloaded WTI crude futures history (from August 2000) with yfinance and computed daily log-returns.
  • Fitted a 3-state Gaussian Hidden Markov Model (full covariance) on the returns, ordering states by mean return to read them as bear, stagnant and bull regimes.
  • Overlaid the regimes on the price history, plotted each regime's return distribution and the transition matrix to show how persistent each regime is.
  • Used hill-climbing structure learning (pgmpy) to learn dependencies between the regime and macro variables; this step uses simulated placeholder variables and demonstrates the method only, not an empirical finding.
Download the notebook

Forecasting Oil Price Regimes: HMM Discretization & Bayesian Networks

Builds a leakage-aware pipeline to forecast next-month oil-price regimes, combining HMM state discretization of 13 market and macro variables with a Bayesian network learned by hill-climbing search.

Python Bayesian Network HMM pgmpy
  • Assembled monthly data from 2000 to 2026 on oil, equities, the USD, the VIX, energy ETFs and US macro series (Yahoo Finance, FRED), with a chronological 80/10/10 train/validation/test split.
  • Trained a 3-state Hidden Markov Model for each of the 13 variables to turn them into bear, stagnant and bull regimes, with the state labelling derived from the training set only.
  • Defined an expert-drafted causal graph and refined it with hill-climbing structure search (maximum 3 parents per node), comparing K2, BIC and BDeu scoring on a one-step-ahead forecast target.
  • Added a guardrail that flags implausibly good validation scores; the final near-perfect accuracy triggered it and is treated as a likely data-leakage artifact, not a real result. The trading simulation showed no gain over buy-and-hold, consistent with that reading.
  • Takeaway: a model that looks perfect usually has a leak, so the next step is to decode regimes causally and re-test.
Download the notebook