Hornli Specific Return

Methodology deep dive

From raw data to daily diagnostics—the full playbook for reproducing Hornli's factor risk model.

Data engineering foundation

We start by staging fundamentals, pricing, and alternative signals in a point-in-time warehouse. Every table carries effective dates, source lineage, and checksum verification so downstream regressions remain reproducible. The entire pipeline is scripted in the public repo with configuration examples for cloud and on-premise deployments.

Exposure engineering follows the steps described in Factor Exposures, producing daily factor decks ready for regression.

Cross-sectional regression engine

On each trading day, the project regresses the vector of stock returns on the design matrix of exposures.

\[r_{t,i} = \sum_{k=1}^{K} x_{t,i,k}\,f_{t,k} + u_{t,i},\]

where x is the matrix of exposures, f are factor returns and u are specific returns.

Daily style and industry factor returns are estimated via weighted least squares with constraints:

  • Winsorizes returns to clip extreme values at the 1 % and 99 % quantiles.
  • Regression weights are proportional to the inverse of specific variance estimates and scaled by the square root of market capitalization.
  • Constraints enforce that cap-weighted sums of country and industry factor returns equal zero.
  • Solve regression using a block matrix inversion to estimate factor returns and specific returns.

Risk attribution

Given factor exposures and the risk model, the proportion of variance explained by factors for a portfolio is computed by:

\[R^2_{\mathrm{port}} = \frac{\beta_{p}^T \Sigma_f \beta_{p}}{\beta_{p}^T \Sigma_f \beta_{p} + w^T\mathrm{diag}(\sigma^2) w},\]

where β_p is the vector of portfolio exposures, Σ_f is the factor covariance matrix and σ^2 is the vector of specific variances. The research script stores panels per asset and date.

Validation & monitoring

Production quality hinges on constant monitoring. We track realized versus implied variance, universe-level R², and median specific return dispersion. Results power the factor risk model hub charts.