Dinakar Murthy
Dinakar Murthy
def ff_expected_return( prices, factor_data, returns_data=False, model="ff3", compounding=True, frequency=252, log_returns=False, ): """ Estimate expected returns using the Fama-French 3- or 5-Factor model. :param prices: asset prices or returns if returns_data=True. :type...
Test for enhancement def test_ff3_expected_return_valid(): df = get_data().iloc[:100, :3] # limit assests and rows for speed dates = df.index factors = pd.DataFrame( { "RF": np.random.normal(0.0001, 0.00001, size=100), "Mkt-RF": np.random.normal(0.0005, 0.001,...