dcajasn / Riskfolio-Lib

Portfolio Optimization and Quantitative Strategic Asset Allocation in Python
https://riskfolio-lib.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
3.05k stars 520 forks source link

Tutorial 22: Some calculations are off? #102

Closed Alexander-Shukaev closed 2 years ago

Alexander-Shukaev commented 2 years ago

Hi, first of all, thanks for the great product, really appreciate all the hard work you put into this library! Running through some of your tutorial examples, I stumbled across a few places, where it appears to me that some calculations are off. Let me summarize it for one of the tutorials:

https://github.com/dcajasn/Riskfolio-Lib/blob/af55dc242baf8e294c66f6ff662b175ce2227922/examples/Tutorial%2022.ipynb?short_path=50289c1#L925

Did you intend to use w_3 instead?

https://github.com/dcajasn/Riskfolio-Lib/blob/af55dc242baf8e294c66f6ff662b175ce2227922/examples/Tutorial%2022.ipynb?short_path=50289c1#L935

252 is usually trading days in a year, while we work with months here. Did you intend to use 12 instead?

https://github.com/dcajasn/Riskfolio-Lib/blob/af55dc242baf8e294c66f6ff662b175ce2227922/examples/Tutorial%2022.ipynb?short_path=50289c1#L1886

Did you intend to multiply by square root of 12 instead?

https://github.com/dcajasn/Riskfolio-Lib/blob/af55dc242baf8e294c66f6ff662b175ce2227922/examples/Tutorial%2022.ipynb?short_path=50289c1#L2175

Shouldn't we multiply by square root of 12 respectively?

dcajasn commented 2 years ago

Hi @Alexander-Shukaev,

Hi, first of all, thanks for the great product, really appreciate all the hard work you put into this library! Running through some of your tutorial examples, I stumbled across a few places, where it appears to me that some calculations are off. Let me summarize it for one of the tutorials:

Here you are right: https://github.com/dcajasn/Riskfolio-Lib/blob/af55dc242baf8e294c66f6ff662b175ce2227922/examples/Tutorial%2022.ipynb?short_path=50289c1#L925

Did you intend to use w_3 instead?

Here you are right too: https://github.com/dcajasn/Riskfolio-Lib/blob/af55dc242baf8e294c66f6ff662b175ce2227922/examples/Tutorial%2022.ipynb?short_path=50289c1#L935

252 is usually trading days in a year, while we work with months here. Did you intend to use 12 instead?

Here you are wrong because the Entropic Drawdown at Risk is a risk measure that can't be annualized, so you only need to annualize the expected return: https://github.com/dcajasn/Riskfolio-Lib/blob/af55dc242baf8e294c66f6ff662b175ce2227922/examples/Tutorial%2022.ipynb?short_path=50289c1#L1886

Did you intend to multiply by square root of 12 instead?

https://github.com/dcajasn/Riskfolio-Lib/blob/af55dc242baf8e294c66f6ff662b175ce2227922/examples/Tutorial%2022.ipynb?short_path=50289c1#L2175

Shouldn't we multiply by square root of 12 respectively?