tidy-finance / website

This repository hosts the source code for the website tidy-finance.org
https://tidy-finance.org
Other
86 stars 49 forks source link

Wrong visualization of cumulative returns for beta sorts #116

Closed voigtstefan closed 4 months ago

voigtstefan commented 4 months ago

The signs are switched when plotting cumulative returns for beta sorts in the chapter "Univariate Portfolio Sorts"

R Version ggplot(aes(x = year, y = 1-value, fill = name)) + geom_col(position = "dodge") + facet_wrap(~name, ncol = 1)

Python Version

.aggregate( low=("low", lambda x: 1-(1+x).prod()), high=("high", lambda x: 1-(1+x).prod()), long_short=("long_short", lambda x: 1-(1+x).prod())

voigtstefan commented 4 months ago

Fixed with commit 23d379f