quantopian / alphalens

Performance analysis of predictive (alpha) stock factors
http://quantopian.github.io/alphalens
Apache License 2.0
3.2k stars 1.12k forks source link

factor_rank_autocorrelation infers turnover period in calendar space while periods could have different time space #323

Closed twiecki closed 5 years ago

twiecki commented 5 years ago

https://github.com/quantopian/alphalens/blob/master/alphalens/performance.py#L796 infers the factor frequency by finding the space between factors. It uses pandas and thus returns a time-difference in calendar space. However, period='10D' most likely refers to 10 trading days (14 days) if factors and prices are only present for trading days. This then causes a problem in the next line https://github.com/quantopian/alphalens/blob/master/alphalens/performance.py#L797 where shift=0 and autocorrelation is shown as 1 constantly.

luca-s commented 5 years ago

Closed by #324