stefan-jansen / machine-learning-for-trading

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

Chapter 4: 06_performance_eval_alphalens.ipynb #245

Closed Quantuary closed 2 years ago

Quantuary commented 2 years ago

Describe the bug

  1. The Mean Period Wise Return chart produces by the create summary_tear_sheet is different from the same chart produces using output from mean_return_by_quantile. e.g. 10D shows a wider spread in the book version, using mean_return_by_quantile. However the tear sheet method shows 5D is superior. Can anyone shed some light please?

tear sheet method: Screenshot from 2022-05-22 13-44-02

vs

mean_return_by_quantile methods: Screenshot from 2022-05-22 13-43-46

stefan-jansen commented 2 years ago

Could this be due to different time frames or other changes to the setup? The tear sheet calls that function so I doubt the output would differ unless the input changes.

Please keep in mind that the code in the notebook is not always 100% identical to what's used to generate the charts in the book, not least because I've sometimes updated examples in response to reader questions or suggestions.

Closing for now, please feel free to reopen if you have further questions.