Fisher-z Correlation Forecasting
Fisher-z 相关性预测:在 Fisher 变换后的实数轴上预测相关性的残差,以解决 \rho \in [-1, 1] 上的异方差和分布畸变。
The problem with forecasting \rho directly
Correlations are bounded (\rho \in [-1, 1]) and heteroskedastic in level: a change of 0.05 near 0 is a very different signal from a change of 0.05 near \pm 1. Sampling noise depends on the level of \rho. This means that:
- Naive MSE loss on \rho is dominated by pairs near the extremes where large \rho values are not even reachable.
- Residuals are not additive: if you try to learn \Delta\rho = \rho_{\text{true}} - \rho_{\text{base}}, the math near the boundaries gets awkward.
- Gradients explode / vanish as \rho \to \pm 1 under most parametric forms.
The Fisher transform
The standard fix (Fisher 1915, used everywhere from meta-analysis to DCC-GARCH) is the z-transform:
z = \operatorname{atanh}(\rho) = \tfrac{1}{2} \log\!\frac{1+\rho}{1-\rho}, \qquad \rho = \tanh(z)
Three properties make z the right work-space:
- Unbounded and approximately linear: z \in \mathbb{R} with z \approx \rho for small \rho but extending naturally to large correlations.
- Variance-stabilising: \text{Var}(z) \approx 1/(n-3) for sample correlation, independent of \rho.
- Additive: residual learning z_{\text{true}} - z_{\text{base}} = \Delta z is well-defined and gradients behave.
Residual learning in Fisher-z space
The Fanshawe–Masih–Cameron THGNN model is trained to predict the deviation from a rolling 30-day baseline:
\hat z_{ij, t+10} = z^{\text{base}}_{ij, t} + \Delta \hat z_{ij, t}, \qquad \hat\rho_{ij, t+10} = \tanh(\hat z_{ij, t+10})
with z^{\text{base}}_{ij, t} = \operatorname{atanh}(\rho^{\text{base}}_{ij, t}) and \rho^{\text{base}} a 30-day rolling return correlation. The model has to at minimum learn deviations from a non-trivial baseline — this defeats the trivial "predict the mean" mode collapse that otherwise plagues noisy financial targets.
Why "residual" matters here
Mode collapse is not abstract. The authors describe it explicitly: initial training with only pointwise Huber loss produced edge predictions bunched in narrow bands per relation class. Once everything sits near the per-head mean, downstream clustering (k-means on the correlation matrix) blurs together and basket trading returns collapse.
The residual formulation has three compounding benefits:
- Anchoring: predictions stay close to a calibrated, well-understood baseline in normal regimes.
- Adaptation: the model can correct for shifts the rolling window cannot anticipate (COVID, Russia-Ukraine).
- Gradient hygiene: z-space residuals are additive and approximately normal, so MSE / Huber gradients are well-behaved across the entire [-1, 1] range.
Loss design — Huber + Gaussian-soft-binning histogram
Two loss components, equal weight:
- Huber edge loss L_{\text{edge}} = \text{Huber}(\hat z_{ij, t+10}, z_{ij, t+10})
- Quadratic near zero, linear in the tails → stable gradients near zero, robust to regime shocks that create large errors.
- Histogram matching loss with Gaussian soft binning (Karandikar et al. 2021)
- Three per-relation-class histograms (6 bins each) + one global market-wide histogram (15 bins).
- Each sample contributes to nearby bins via Gaussian weights (differentiable, unlike hard binning).
- Forces the distribution of predicted correlations to match the realised distribution — preserves the shape of the correlation matrix, not just pointwise accuracy.
The overall loss is L = L_{\text{edge}} + s \cdot L_{\text{histo}} with s = 7 to put both terms on comparable scale. Without the histogram term, the model learns accurate mean values but loses the tail structure that basket clustering needs.
Empirical calibration
On 269 M out-of-sample edges (2019–2024 S&P 500, 10-day-ahead target):
| Metric | Persistence baseline (20d rolling) | THGNN |
|---|---|---|
| MAE | 0.3071 | 0.2302 |
| RMSE | 0.3852 | 0.2940 |
| Bias | −0.0049 | −0.0012 |
| Pearson r | 0.310 | 0.778 |
| Spearman \rho | 0.314 | 0.795 |
Note: the paper evaluates against a 20-day rolling baseline for the persistence comparison even though the model is trained against a 30-day baseline internally. The 30-day vs 20-day choice is immaterial for the headline result — the gap is dominated by the ML signal.
Practitioner notes
- Always residual when forecasting noisy bounded variables against a known calibrated baseline. The structure of the problem makes "predict \Delta z" easier than "predict z".
- The histogram loss is the load-bearing detail that makes correlation matrix forecasting usable for portfolio construction. Without it, downstream clustering is killed by mode collapse.
- Back-transform with \tanh at the very end. Never round-trip through \rho \to z \to \rho \to z inside the loss.
- Watch for leakage between the rolling baseline window and the rolling feature windows. The paper uses 60-day z-score for features and 30-day rolling for the correlation baseline; both end at t, the target is at t+10, so there is no leakage from the future, but feature/baseline overlap is a perennial footgun.
Notation summary
| Symbol | Meaning |
|---|---|
| \rho_{ij} | Return correlation between stocks i, j |
| z_{ij} | \operatorname{atanh}(\rho_{ij}) — Fisher-z transform |
| z^{\text{base}}_{ij,t} | Fisher-z of 30-day rolling baseline correlation at t |
| \Delta \hat z_{ij, t} | Model's predicted residual in Fisher-z space |
| \hat \rho_{ij, t+10} | Final prediction after back-transform: \tanh(z^{\text{base}} + \Delta \hat z) |