Factor Model#

Decomposes portfolio return into per-factor contributions plus an idiosyncratic residual, using user-supplied factor return series (style factors such as size, momentum, beta, residual volatility and value, plus industry factors).

Formulas#

For each date:

\[\begin{split}\text{factor\_contribution}_f &= \sum_{\text{assets}} \text{weight}_{\text{asset}} \cdot \text{factor\_return}_{f,\text{asset}} \\ \text{portfolio\_return} &= \sum_{\text{assets}} \text{weight}_{\text{asset}} \cdot \text{asset\_return}_{\text{asset}}\end{split}\]

Contributions are accumulated over time (cumulative sum). The percentage decomposition divides each factor’s contribution by the total return and captures the unexplained part as an idiosyncratic residual (f_idio_returns).

Implementation#

The PyArrow-based implementation lives in FactorModelArrowAttribution, implementing FactorModelArrowAttributionInterface. A pandas-based reference implementation is also available as FactorModelAttribution. See Factor Model for the full API reference.

Enable this methodology by setting factor_model_method = yes in attribution_analysis_parameters.xlsx (see Configuration Reference). When enabled and the entry script runs with launch_dashboard=True, an interactive Dash dashboard is served on dashboard_port (see Dashboard); with only Brinson-Fachler enabled, static matplotlib plots are produced instead.