Fama-French Models API
Fama-French factor models implementation.
fama_french_five_factor(risk_free_rate, market_beta, size_beta, value_beta, profitability_beta, investment_beta, market_premium, size_premium, value_premium, profitability_premium, investment_premium)
Calculate expected return using the Fama-French Five-Factor model.
Formula: E(R) = Rf + β_m(Rm-Rf) + β_s(SMB) + β_v(HML) + β_p(RMW) + β_i(CMA)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
risk_free_rate
|
float or array - like
|
Risk-free rate of return (e.g., 0.03 for 3%) |
required |
market_beta
|
float or array - like
|
Beta coefficient for market risk factor |
required |
size_beta
|
float or array - like
|
Beta coefficient for size factor (SMB - Small Minus Big) |
required |
value_beta
|
float or array - like
|
Beta coefficient for value factor (HML - High Minus Low) |
required |
profitability_beta
|
float or array - like
|
Beta coefficient for profitability factor (RMW - Robust Minus Weak) |
required |
investment_beta
|
float or array - like
|
Beta coefficient for investment factor (CMA - Conservative Minus Aggressive) |
required |
market_premium
|
float or array - like
|
Market risk premium (Rm - Rf) |
required |
size_premium
|
float or array - like
|
Size premium (SMB) |
required |
value_premium
|
float or array - like
|
Value premium (HML) |
required |
profitability_premium
|
float or array - like
|
Profitability premium (RMW) |
required |
investment_premium
|
float or array - like
|
Investment premium (CMA) |
required |
Returns:
Type | Description |
---|---|
dict
|
Expected return and factor contributions |
Raises:
Type | Description |
---|---|
ValueError
|
If any of the input arrays are not of the same shape |
fama_french_three_factor(risk_free_rate, market_beta, size_beta, value_beta, market_premium, size_premium, value_premium)
Calculate expected return using the Fama-French Three-Factor model.
Formula: E(R) = Rf + β_m(Rm-Rf) + β_s(SMB) + β_v(HML)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
risk_free_rate
|
float or array - like
|
Risk-free rate of return (e.g., 0.03 for 3%) |
required |
market_beta
|
float or array - like
|
Beta coefficient for market risk factor |
required |
size_beta
|
float or array - like
|
Beta coefficient for size factor (SMB - Small Minus Big) |
required |
value_beta
|
float or array - like
|
Beta coefficient for value factor (HML - High Minus Low) |
required |
market_premium
|
float or array - like
|
Market risk premium (Rm - Rf) |
required |
size_premium
|
float or array - like
|
Size premium (SMB) |
required |
value_premium
|
float or array - like
|
Value premium (HML) |
required |
Returns:
Type | Description |
---|---|
dict
|
Expected return and factor contributions |
Raises:
Type | Description |
---|---|
ValueError
|
If any of the input arrays are not of the same shape |