Welcome to the Quant Sandbox

Imperial College Business School ยท Building a Quantitative Portfolio

Recommended Learning Path

This tool has 19 modules across three difficulty levels: Beginner, Intermediate, and Advanced. Follow them in order to build understanding progressively โ€” from factor theory to portfolio construction, backtesting, stress testing, and critical evaluation. Each module takes 10โ€“15 minutes.

๐Ÿ“Š
Step 1 of 19Beginner~10 min

Factor Scores

Learning Objective

Understand how quantitative signals (momentum, value, quality, low-vol, size) are computed and combined into a composite score.

Key Concept

Z-scoring & winsorisation remove outlier distortion. The composite score = ฮฃ wแตข ร— zแตข.

1 / 19

Factor Scores

Factor Scores

Assign weights to each factor. The composite score ranks the top 100 S&P 500 stocks (by market cap, all major sectors) using z-scored, winsorised signals.

Set Momentum to 3 and all other factors to 1. Click 'Apply Weights' and observe which stocks rise to the top. Then try the opposite: set Value to 3 and Momentum to 0. How does the top-20 list change? This shows how different factor views produce different portfolios.

How Factor Scores Work

Each factor is z-scored (mean 0, std 1) and winsorised at ยฑ3ฯƒ to remove outliers. The composite score is a weighted sum: Score = ฮฃ wแตข ร— zแตข. Adjust the sliders to see how different factor tilts change the stock ranking.

Factor Construction โ€” Academic Disclosure

Factor scores use a two-tier system: fundamental data from Yahoo Finance is preferred when available, with price-based proxies as fallback. Coverage varies by stock โ€” some may use fundamentals while others fall back to proxies.

  • Value โ€” primary: inverse P/E ratio (Fama & French, 1992); fallback: negative 12-month price return (mean-reversion proxy).
  • Size โ€” primary: inverse log market capitalisation (Banz, 1981); fallback: inverse share price.
  • Quality โ€” primary: Return on Equity (Novy-Marx, 2013 uses gross profitability; ROE is a related proxy); fallback: trailing Sharpe ratio.

Momentum (12-month price return) and Low Volatility (inverse 252-day volatility) are correctly constructed from price data alone and match their academic definitions. Fundamental data availability depends on Yahoo Finance coverage โ€” typically 80โ€“90% of S&P 500 stocks.

The Factor Zoo Problem

Academic researchers have documented over 400 "factors" that appear to predict returns in historical data (Harvey, Liu & Zhu, 2016). The majority are likely false discoveries due to data mining and publication bias. This tool implements five of the most replicated factors: Momentum (Jegadeesh & Titman, 1993), Low Volatility (Ang et al., 2006), Value (Fama & French, 1992), Size (Banz, 1981), and Quality (Novy-Marx, 2013). Even these canonical factors have experienced multi-year drawdown periods and their premiums may be arbitraged away over time.

Reference: Harvey, C. R., Liu, Y., & Zhu, H. (2016). "โ€ฆ and the Cross-Section of Expected Returns." Review of Financial Studies, 29(1), 5โ€“68.

Factor Weights
0 = excluded ยท 5 = maximum weight
Momentum

12-1 month price return (skip last month to avoid short-term reversal). Stocks that have risen tend to keep rising (Jegadeesh & Titman, 1993).

1.0
Low Volatility

Inverse of 252-day annualised realised volatility. Low-risk stocks earn higher risk-adjusted returns (Ang et al., 2006; Black, 1972).

1.0
Quality

Return on Equity (ROE) from yfinance fundamentals when available; falls back to excess-return Sharpe ratio. The canonical Quality factor (Novy-Marx, 2013) uses gross profitability (gross profit / total assets).

1.0
Value

Earnings Yield (1 / trailing P/E) from yfinance fundamentals when available; falls back to negative 12-month price return. The canonical Value factor (Fama & French, 1992) uses price-to-book ratio.

1.0
Size

Inverse log market capitalisation from yfinance when available; falls back to inverse log share price. Smaller firms earn a size premium (Banz, 1981; Fama & French, 1992 SMB factor).

1.0
Top 20 Stocks โ€” Composite Score
Ranked by weighted composite factor score (0โ€“100)
Full Stock Ranking
Top 100 S&P 500 stocks by market cap. All factor scores are z-scored raw values.