factor_analysis
Decompose portfolio returns into Fama-French factors to identify alpha versus factor exposure. Use after backtesting to understand return sources.
Instructions
Decompose strategy or portfolio returns into Fama-French factors using OLS regression.
Breaks down returns into exposures to four systematic factors:
Mkt-RF (market risk premium): how much return comes from overall market movement
SMB (small minus big): size factor exposure
HML (high minus low): value factor exposure
Mom (momentum): momentum factor exposure
Also estimates alpha (excess return not explained by factors) with t-statistic for statistical significance. A |t-stat| > 2 suggests statistically significant alpha.
Returns alpha (daily and annualized), factor loadings with t-statistics, R-squared (how much of return variance is explained by factors), and residual volatility.
Use this after backtest_strategy to understand WHERE your returns come from — is it genuine alpha or just factor exposure?
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| equity_curve | Yes | Equity curve as a list of {date, value} objects. Typically from the output of backtest_strategy. Needs at least 30 data points. Example: [{date: '2023-01-03', value: 100000}, {date: '2023-01-04', value: 100500}, ...] |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |