Open Alexander-Shukaev opened 1 year ago
Just to summarize, it feels like compounding=not log_returns
produces the expected mathematically correct result.
Yes, I agree. Honestly I feel that the whole compounding/log returns thing was not very well thought out.
I don't think I should have added support for log returns in the first place. I'm not going to make the breaking change of removing it, but equally I don't want to make the codebase more dirty by having the 2x2 handling of compounding
and log_returns
.. this would need to be duplicated in every function that supports both parameters.
So for now I will leave this issue up as a reminder/warning of unexpected behaviour, but I don't intend to fix it
https://github.com/robertmartin8/PyPortfolioOpt/blob/6644741ff27fca5f2aaeefd63e31d157cfd718ae/pypfopt/expected_returns.py#L145
As a follow up on similar issues from #241, shouldn't
log_returns=True
affect how compounding is done as percompounding=True
? I was under impression that log returns are additive and hence should be compounded by simply adding them together.