Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Beneficious Alpha Tutorial: Event Study

This is an example of how to conduct an event study in Quantopian.

2 responses

Have you seen this?

FYI Anyone who lands on this page. There's an event study built into AlphaLens.


"""  
create_full_tear_sheet(factor_data, long_short=False, group_neutral=False, by_group=False)  
create_event_returns_tear_sheet(factor_data, prices, avgretplot=(3, 11),  
                                long_short=False, group_neutral=False, by_group=False)  
    factor_data : pd.DataFrame - MultiIndex  
        A MultiIndex DataFrame indexed by date (level 0) and asset (level 1),  
        containing the values for a single alpha factor, forward returns for  
        each period, the factor quantile/bin that factor value belongs to,  
        and (optionally) the group the asset belongs to.  
        - See full explanation in utils.get_clean_factor_and_forward_returns  
    long_short : bool  
        Should this computation happen on a long short portfolio? if so, then  
        mean quantile returns will be demeaned across the factor universe.  
        Additionally factor values will be demeaned across the factor universe  
        when factor weighting the portfolio for cumulative returns plots  
    group_neutral : bool  
        Should this computation happen on a group neutral portfolio? if so,  
        returns demeaning will occur on the group level.  
        Additionally each group will weight the same in cumulative returns  
        plots  
    by_group : bool  
        If True, display graphs separately for each group.  
"""