April 2019
Intermediate to advanced
426 pages
11h 13m
English
In the previous section, we used a single asset with the prices of GS for fitting our linear regression model. This same model, LinearRegressionModel, accommodates multiple assets. Run the following commands to create an instance of this model and use our new datasets:
In [ ]: multi_linear_model = LinearRegressionModel() multi_linear_model.learn(df_lagged, y, start_date='2018', end_date='2019', lookback_period=10)
In the linear regression model instance, multi_linear_model, the learn() command is supplied with the df_lagged dataset with 16 features and y as the percentage changes of JPM. The lookback_period value is reduced in consideration of the limited lagged returns data available. Let's plot the ...
Read now
Unlock full access