## Trading strategy

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.

Signal 12-month momentum, skipping the most recent month.
Neutralization Project out sector dummy exposure, then re-rank stocks.
Portfolio Long-only, equal-weight top decile, monthly rebalance.
Costs 5 bps per unit of one-way turnover, including initial buy.

### Alpha and t-stat

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).

## Generate a new alpha

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.)

### Synthetic-market alpha distribution

#### How to read this chart

Each bar counts how many of the 300 synthetic markets produced an annualized FF 4-factor alpha in that range. The gold vertical line marks the real alpha from the actual historical return panel — this is your baseline. When you click Generate, a coral dotted line appears showing where that single fresh synthetic market landed.

If the gold line sits near the middle of the histogram, the real alpha is typical of what the factor structure produces — it's not a lucky outlier. If it sat far in the right tail (say, above 95% of paths), that would suggest the strategy only worked because of the particular sequence of months we lived through.

The distribution itself is centered near the real alpha (~4–5% annualized) because the factor loadings B are held fixed — the bootstrap is testing path order, not whether a momentum factor exists at all.

### Generated path — long-only equity curve

#### How to read this chart

This chart appears after you click Generate. It shows the cumulative return (compounded growth of $1) for the top-decile long-only momentum portfolio on a single synthetic market.

Cumulative return means each point is (1 + r1)(1 + r2)...(1 + rt) − 1 — the total return from the start of the synthetic timeline to month t, including the compounding of all prior gains and losses. A value of +2.0 means the portfolio tripled the initial capital; −0.5 means half the capital was lost.

The x-axis label "synthetic month" is just a sequential month counter (1, 2, 3, …) rather than a calendar date — each synthetic market reshuffles real historical months into a new order, so there is no real date to anchor to. Month 1 is the first month of the reshuffled timeline, month 2 is the second, and so on for the full ~240-month span.

The annotation at the top reports three numbers for this path: its annualized FF alpha, its t-statistic, and what percentile it falls at within the precomputed distribution (0th = worst, 100th = best). Compare this to the gold line in the histogram — is this path better or worse than the real one?

## Performance — how did the portfolio do?

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.

### Equity curves (net of cost)

Long-only top decile vs the equal-weight universe (the fair benchmark) and the long-short book.

### Long-only drawdown

Peak-to-trough drop of the compounded wealth curve.

## Factor diagnostics — which signals predict next-month returns?

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.

### Mean information coefficient by factor

Bars = mean monthly IC; momentum is the only positive-IC factor.

### Cross-factor rank correlation (Gram matrix)

Momentum vs quality ≈ 0.86 — nearly collinear, redundant information.

### Walk-forward IC (5-year windows)

Momentum IC by subperiod — regime-dependent; the 2006–11 window includes the 2008–09 crash.

## Risk decomposition — where does the portfolio's variance live?

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).

### Eigenvalue scree + Marchenko–Pastur cutoff

Eigenvalues above λ+ (dashed) are statistically significant factors; the rest is noise.

### Systematic vs idiosyncratic risk

Variance in the top-k eigenspace vs its orthogonal complement.

## Ticker explorer — stocks in factor space

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.

Ticker

### PC1 vs PC2 loadings, colored by sector

Select a ticker to see its momentum score, sector, and factor loadings.

## Notebook process — what this project did

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.

01

### 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.

02

### Diagnose factors

Compute price-based momentum, value, quality, and low-volatility proxies; measure IC, decay, stability, turnover proxy, and cross-factor correlation.

03

### Construct the signal

Winsorize, z-score, sector-neutralize, and compare momentum-only against a four-factor composite. Momentum-only is the cleaner signal.

04

### Backtest and challenge it

Trade the top decile long-only, subtract turnover costs, run Fama-French alpha, HAC t-stats, beta checks, survivorship drag, and robustness grids.

05

### Decompose risk

Estimate covariance, run PCA, use Marchenko-Pastur to choose signal factors, and split portfolio variance into systematic and idiosyncratic pieces.

06

### Synthesize markets

Write R ≈ F BT + E, block-bootstrap matched rows of F and E, rebuild R, and rerun the strategy on alternate histories.

### Synthetic panel construction

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.

### Heuristic picture

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.

### Links

- pawelsarkowicz.xyz
- Factor Risk Decomposition repo
- License
- Kenneth French Data Library
- yfinance