Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
How is the mean period wise return calculated

Sorry if it is a newby question, im new to quantopian.
Im trying to replicate the alphales results to understand them, but I'm not beeing able to do it.

factor_data = run_pipeline(make_pipeline(), startDay, endDay) #build factors

dfAAPL = get_pricing(symbols('AAPL'), start_date=startDay, end_date=endDay) #get apple Pricing  
aaplResults = factor_data.xs(symbols('AAPL'), level=1) #get just apple factors  
df = dfAAPL.join(aaplResults) # join aaple factors + price  

I asume the returns are calculated:
Future Open / Today Open - 1

So I make the calculation

days = [1,2,3,4,5,10,15,20]  
for d in days:  
    returns ='{}DRetun'.format(d)  
    df[returns] = df['open_price'].shift(-d)/df['open_price']  
    res = df[df['Factor'] == 1]

    print(returns,(res[returns].mean()-1)*100 ,(res[returns].mean()-1)*100/d) #maybe its was the mean return by days?  

Foward, Return, Mean Days Return
('1DRetun', 0.24037338368763095, 0.24037338368763095)

('2DRetun', -0.18177306856032027, -0.09088653428016014)

('3DRetun', 0.28722005736183664, 0.09574001912061221)

('4DRetun', 0.5946041417401515, 0.14865103543503788)

('5DRetun', 0.8046724143346617, 0.16093448286693235)

('10DRetun', 1.1221817218125096, 0.11221817218125096)

('15DRetun', 1.2784627411053462, 0.08523084940702308)

('20DRetun', 2.4049766319204746, 0.12024883159602373)

But the pipeline Results are

pricing_data = get_pricing(  
  symbols=factor_data.index.levels[1], # Finds all assets that appear at least once in "factor_data"  
  start_date=startDay,  
  end_date=endDay, # must be after run_pipeline()'s end date. Explained more in lesson 4  
  fields='open_price' # Generally, you should use open pricing. Explained more in lesson 4  
)

merged_data = get_clean_factor_and_forward_returns(  
  factor=factor_data,  
  prices=pricing_data,  
  quantiles=None,  
  bins=[-2,-1,0,1,2],  
  periods = [1,2,3,4,5,10,15,20]  
)

create_full_tear_sheet(merged_data)  

---------------------------------------------------- -1D-----2D-----3D------4D------5D----10D----15D----20D
Mean Period Wise Return Top Quantile (bps) -0.080 / -1.058 / 1.157 / 1.136 / 1.428 / 1.568 / 0.871 / 0.812

I dont get it.
Is there some place where I can see what the alphalens results mean and how are they calculated?
What is Ann. alpha? What is beta? I know beta is how much my performances is linked to the performance of the market