Factor regression, factor allocation and factor statistics: methodology
This page describes the factor regression and the other tools on the Factors page as the code calculates them: which factor data are used, how loadings (factor sensitivities), t-statistics and alpha are derived, how factor allocation searches for new weights and which metrics the factor statistics show. The basics are explained in the article Fama-French factors.
Factor data and models
The basis is monthly factor returns following the methodology of Fama and French (1993) and Fama and French (2015): market excess return (market minus risk-free rate), size (SMB), value (HML) and, in the five-factor model, also profitability (RMW) and investment (CMA). Momentum (MOM) following Carhart (1997) can be added optionally. There are 15 models to choose from for eight regions: USA, North America, Europe, Japan, Asia Pacific ex Japan, Developed markets and Developed markets ex US (each with three or five factors) and Emerging markets (five factors only).
Optionally, Portfolio Lab adds two bond factors: term, as the return on long-term US Treasuries minus the money market, and credit, as the return on long-term US corporate bonds minus long-term Treasuries, both derived from the total returns of US bond funds. They need at least 24 common months; if they are missing, the tool continues without them and says so.
The factor data are in US dollars. The whole tool therefore calculates in USD: funds and portfolios are converted into dollars before they are regressed on the factors. If your base currency is not the dollar, you thus see the factor profile without currency effects; the return in your base currency itself is shown in the Backtest.
The regression
For each selected security or portfolio, the monthly returns (month-end, portfolios reset to their weights every month) are aligned with the factors over the common months. This is followed by a least squares regression of the excess return on the factors:
r_t − RF_t = α + β_M · (Market − RF)_t + β_SMB · SMB_t + β_HML · HML_t + … + ε_t- r_t
- monthly return of the fund in USD
- RF_t
- risk-free rate for the month from the factor data
- β
- loadings, i.e. the sensitivity to each factor
- α
- monthly alpha, shown as (1 + α)^12 − 1
- t-statistics and p-values from the classical covariance matrix σ² (X′X)⁻¹ with n − k degrees of freedom (n months, k coefficients including the intercept), with two-sided p-values from the t distribution. You can switch to Newey-West: covariance following Newey and West (1987) with Bartlett weights, ⌊4 · (n/100)^(2/9)⌋ lags (4 for 120 months) and the factor n / (n − k).
- R² and adjusted R²: the share of the variance of the excess return that the factors explain.
- Residual volatility: standard deviation of the residuals × √12, i.e. the risk that no factor explains.
- Minimum length: more than k + 5 common months; otherwise the regression stops with a note.
The classical t-statistics assume independent, identically distributed residuals. If the residuals are autocorrelated or their variance fluctuates, the Newey-West standard errors are larger and the t-statistics smaller. If the two versions are far apart, the classical t-statistic is too optimistic. A single t-statistic around 2 is weak anyway when many funds and factors are tested. Harvey et al. (2016) recommend a hurdle of 3 for new factors.
Rolling regression
In addition, the tool estimates the loadings over a moving window of 24 to 120 months in steps of six (default 36). Each point is a separate regression over the most recent window of months, with the alpha again annualized. This shows whether a fund has moved over time from a value to a growth style or from small to large companies.
Return attribution
Because the regression has an intercept, the mean of the residuals is exactly zero. This means that the average return can be split exactly into contributions, arithmetically and annualized (× 12):
avg. return p.a. = avg. RF p.a. + Σ β_f · avg. factor return_f p.a. + α · 12Month by month, the tool shows the same attribution as an area chart: risk-free rate, β · factor for each factor, and “Alpha + residual” as the difference from the actual monthly return. Each row always adds up exactly to the return for that month.
Factor allocation
Factor allocation works in two steps. First, it regresses each security in the grid and each additionally selected asset on the factor model, over the common period or the last 36, 60 or 120 months. Because the regression is linear, the loadings of a portfolio reset monthly are exactly the weighted sum of the individual loadings. Likewise, the variance of the portfolio's excess return splits into factor risk and residual risk, because the residuals are uncorrelated with the factors:
Var(portfolio) = b′ Σ_F b + w′ Ω w, share of factor f = b_f · (Σ_F b)_f / Var- b
- loadings of the portfolio (B · w)
- Σ_F
- covariance matrix of the factors
- Ω
- covariance matrix of the residuals
In the second step, an optimizer (SLSQP) searches for new weights: no short selling, a total of 100%, and a maximum weight per asset between 10 and 100% in steps of five. Stage 1 minimizes the squared deviation of the loadings from the target values (factors without a target remain free). Stage 2 chooses, among all solutions that are at most 0.01 worse for each target factor, the one that best meets the selected secondary goal: minimize turnover (‖w − w₀‖²), minimize residual risk or minimize total risk. If a target is missed by more than 0.05, the tool names the factor that is furthest off. The turnover is ½ Σ |w_new − w_old|.
Replicating factors
“Replicate factors” builds a portfolio from building blocks (templates with style and factor asset classes, or your own securities) that resembles a fund as closely as possible. In the “Hit factor exposures” mode, stage 1 above applies first, with the target fund's loadings as target values, and the tracking error is then minimized. In the “Tracking error only” mode, stage 1 is skipped. This corresponds to a style analysis with the building blocks (Style analysis methodology). The estimation uses the last 60 months (selectable); if at least twelve months of data are available before that, the tool also shows an out-of-sample test with return, volatility, drawdown, tracking error and correlation.
Factor statistics
The factor statistics treat each factor like an asset. SMB, HML, RMW, CMA and momentum are long-short portfolios; their return is the premium itself, and for the market it is the excess return. Performance and drawdowns compound (1 + premium), as if the premium were reinvested monthly. The metrics:
- Average premium p.a. (monthly mean × 12) and geometric premium p.a., volatility (× √12), Sharpe ratio (mean / standard deviation × √12).
- t-statistic of the premium = monthly mean / (standard deviation / √n). It tests whether the premium differs from zero.
- Share of positive months, best and worst month and calendar year, maximum drawdown, longest period below the previous high in months, skewness and excess kurtosis.
- Share of rolling 5-year and 10-year periods (or of the selected period of 3, 5, 10 or 20 years) with a positive premium; premiums per decade from 24 months of data.
In the regional comparison, the statistics show one factor across up to eight regions; profitability and investment come from the five-factor models, and emerging markets are only available there. Optionally, all regions can be trimmed to their common period. Periods: full history or the last 10, 20, 30 or 50 years, at least 24 months.
Limitations
- Factors are paper portfolios without trading costs, taxes and short-selling fees. A premium in the data set cannot be captured one to one by an investor.
- The regression explains the past. Loadings fluctuate, especially with short windows; a fund's alpha is usually statistically uncertain.
- All calculations run in USD and with monthly data; the current month is missing from the factor data.
Frequently asked questions
Why does the factor regression calculate in dollars?
Because the factor returns are in US dollars. If you regressed returns in another currency, such as euros, on dollar factors, the exchange rate would end up in the alpha and the residuals.
What does a market beta of 0.9 mean?
If the market excess return rose by 1 percentage point in a month, the fund's excess return rose by 0.9 percentage points on average, with the other factors unchanged.
When is an alpha credible?
When its t-statistic is well above 2, the period is long and the alpha also remains stable in the rolling regression. When many funds are compared, there is a strong case for a stricter threshold of 3.
What is the difference from style analysis?
Factor regression uses long-short factors and allows any loadings. Style analysis explains a fund with investable indices and weights that are non-negative and add up to 100%.
Literature
- Carhart, Mark M. (1997): On Persistence in Mutual Fund Performance. The Journal of Finance 52 (1), pp. 57–82. doi:10.1111/j.1540-6261.1997.tb03808.x
- Fama, Eugene F.; French, Kenneth R. (1993): Common risk factors in the returns on stocks and bonds. Journal of Financial Economics 33 (1), pp. 3–56. doi:10.1016/0304-405x(93)90023-5
- Fama, Eugene F.; French, Kenneth R. (2015): A five-factor asset pricing model. Journal of Financial Economics 116 (1), pp. 1–22. doi:10.1016/j.jfineco.2014.10.010
- Harvey, Campbell R.; Liu, Yan; Zhu, Heqing (2016): … and the Cross-Section of Expected Returns. Review of Financial Studies 29 (1), pp. 5–68. doi:10.1093/rfs/hhv059
- Newey, Whitney K.; West, Kenneth D. (1987): A Simple, Positive Semi-Definite, Heteroskedasticity and Autocorrelation Consistent Covariance Matrix. Econometrica 55 (3). doi:10.2307/1913610
This page describes how Portfolio Lab calculates; past results are not a forecast. All terms in the glossary.