stefan-jansen / machine-learning-for-trading

Code for Machine Learning for Algorithmic Trading, 2nd edition.
https://ml4trading.io
13.52k stars 4.26k forks source link

Dependent variable of market beta estimation #291

Closed mk0417 closed 1 year ago

mk0417 commented 1 year ago

https://github.com/stefan-jansen/machine-learning-for-trading/blob/main/11_decision_trees_random_forests/00_data_prep.ipynb

Why minus market premium when estimating market beta? factor_data['return_1m'] -= factor_data['Mkt-RF']

The dependent variable should be the difference between stock return and risk-free rate factor_data['return_1m'] -= factor_data['RF']

stefan-jansen commented 1 year ago

That's correct, will update in the next edition.