Enhance the expected_returns module by adding a new function ff_expected_return() that computes expected returns using the Fama-French 3-factor and 5-factor models via OLS regression.
This will expand the current set of return estimation methods (mean_historical_return, capm_return, etc.) with a more advanced and academically grounded model, improving flexibility for users in quantitative finance applications.
def ff_expected_return(
prices: pd.DataFrame,
factor_data: pd.DataFrame,
returns_data: bool = False,
model: str = "ff3",
compounding: bool = True,
frequency: int = 252,
log_returns: bool = False,
) -> pd.Series: