Build the return matrix
Use cached S&P 500 constituent and adjusted-price data to assemble monthly returns, sectors, breadth, dispersion, and an equal-weight baseline.
Factor Risk Decomposition
Interactive research dashboard for factor diagnostics, PCA risk, and synthetic-market stress tests.
Rank large-cap stocks by trailing 12-1 momentum, remove sector tilts, hold the top decile equal-weight, and rebalance monthly net of turnover costs.
Alpha is the regression intercept: the average return left after subtracting exposure to benchmark factors. The t-statistic is alpha divided by its standard error; larger absolute values mean the estimate is less likely to be noise.
The four Fama-French factors used here are MKT (market excess return), SMB (Small Minus Big size factor), HML (High Minus Low value factor), and MOM (winner-minus-loser momentum factor).
Draw an alternate market path from the factor model, re-run the momentum backtest, and see whether the generated alpha lands near the real one. A "Share ≥ real" near 50% is the ideal — it means the real alpha is typical, not a lucky outlier.
Why is the baseline alpha here (~4.5%) lower than the headline 5.97% above? The stress test uses a simplified pipeline — raw 12-1 momentum with no sector neutralization and no transaction costs, run on the balanced PCA panel (~394 stocks) instead of the full universe. This keeps each bootstrap path fast enough to compute. The stress test answers the same question either way: is the alpha a lucky path? (No.)
A top-decile long-only momentum portfolio, rebalanced monthly net of 5 bps per unit of one-way turnover. Benchmarked against the equal-weight universe.
Long-only top decile vs the equal-weight universe (the fair benchmark) and the long-short book.
Peak-to-trough drop of the compounded wealth curve.
Information coefficient (IC) = Spearman rank correlation between the factor vector and next-month returns — the cosine of the angle between the rank vectors. Momentum is the only factor with positive IC.
Bars = mean monthly IC; momentum is the only positive-IC factor.
Momentum vs quality ≈ 0.86 — nearly collinear, redundant information.
Momentum IC by subperiod — regime-dependent; the 2006–11 window includes the 2008–09 crash.
Eigendecompose the covariance Σ = VΛVT. Marchenko–Pastur (random matrix theory) separates signal eigenvalues from noise. Portfolio variance wTΣw splits into the top-k factor subspace (systematic) and its orthogonal complement (idiosyncratic).
Eigenvalues above λ+ (dashed) are statistically significant factors; the rest is noise.
Variance in the top-k eigenspace vs its orthogonal complement.
Each stock's loadings on PC1 (≈ the market factor) and PC2 (≈ value), colored by sector. Marker size = latest momentum score. Pick a ticker for its details.
The app is a compact view of the notebook pipeline: build the return matrix, test factors, construct the signal, backtest it, decompose risk, then stress-test the alpha with synthetic markets.
Use cached S&P 500 constituent and adjusted-price data to assemble monthly returns, sectors, breadth, dispersion, and an equal-weight baseline.
Compute price-based momentum, value, quality, and low-volatility proxies; measure IC, decay, stability, turnover proxy, and cross-factor correlation.
Winsorize, z-score, sector-neutralize, and compare momentum-only against a four-factor composite. Momentum-only is the cleaner signal.
Trade the top decile long-only, subtract turnover costs, run Fama-French alpha, HAC t-stats, beta checks, survivorship drag, and robustness grids.
Estimate covariance, run PCA, use Marchenko-Pastur to choose signal factors, and split portfolio variance into systematic and idiosyncratic pieces.
Write R ≈ F BT + E, block-bootstrap matched rows of F and E, rebuild R, and rerun the strategy on alternate histories.
The return matrix R is decomposed into factor scores F, stock loadings B, and residuals E. A synthetic path resamples matched rows of F and E in short blocks, then reconstructs Rsynth = FbootBT + Eboot + mean(r). Matching the rows matters because it keeps market-wide shocks and stock-specific shocks internally consistent.
Think of historical months as index cards. Instead of shuffling single cards, the bootstrap shuffles small packets of neighboring cards, so short regimes like selloffs, rebounds, and momentum bursts mostly stay intact. Each shuffled deck is an alternate market history; the app reruns the same strategy and records the alpha.