Module Expr Str Import alias identifier Import alias identifier Import alias identifier Import alias identifier Import alias identifier FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults Num Num Str NameLoad NameLoad Str body Expr Str Assign NameStore Call AttributeLoad SubscriptLoad NameLoad Index Str attr Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr If CompareEq NameLoad NameLoad body Assign NameStore BinOpSub NameLoad SubscriptLoad NameLoad Index NameLoad Delete SubscriptDel NameLoad Index NameLoad Delete SubscriptDel NameLoad Index NameLoad Assign NameStore Call AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr Assign SubscriptStore AttributeLoad NameLoad attr ExtSlice Slice Num NameLoad Slice AttributeLoad NameLoad attr Assign SubscriptStore AttributeLoad NameLoad attr ExtSlice Slice UnaryOpUSub NameLoad Slice AttributeLoad NameLoad attr Assign NameStore Call NameLoad Call AttributeLoad Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr attr Assert CompareGt NameLoad Num Str Assign NameStore Str For TupleStore NameStore NameStore Call NameLoad AttributeLoad NameLoad attr body For TupleStore NameStore NameStore Call NameLoad AttributeLoad NameLoad attr body If CompareEq SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index NameLoad Num body Assign NameStore SubscriptLoad SubscriptLoad NameLoad Index NameLoad Slice BinOpSub NameLoad NameLoad BinOpAdd BinOpAdd NameLoad Num NameLoad If CompareEq Call NameLoad NameLoad Call NameLoad Str body Assign NameStore NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad If CompareEq Call NameLoad AttributeLoad NameLoad attr Num body Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword Num Assign NameStore Call AttributeLoad NameLoad attr BinOpAdd NameLoad Num keyword Num Assign NameStore AttributeLoad BinOpDiv AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword Num Assign NameStore Call NameLoad UnaryOpUSub NameLoad BinOpAdd NameLoad Num Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr keyword Num keyword UnaryOpUSub NameLoad keyword NameLoad keyword Str If CompareEq NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Slice NameLoad SubscriptLoad NameLoad Slice NameLoad keyword SubscriptLoad NameLoad Slice NameLoad keyword Str keyword Num Expr Call AttributeLoad NameLoad attr NameLoad NameLoad keyword Num keyword Str keyword Str Expr Call AttributeLoad NameLoad attr BinOpSub UnaryOpUSub NameLoad Num BinOpAdd NameLoad Num If CompareEq NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd Str Call NameLoad NameLoad Str orelse Expr Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd Str Call NameLoad NameLoad Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad keyword Str decorator_list
N/A N/A 
(c) 2011, 2012 Georgia Tech Research Corporation
This source code is released under the New BSD license.  Please see
http://wiki.quantsoftware.org/index.php?title=QSTK_License
for license details.

Created on Jan 16, 2013

@author: Sourabh Bajaj
@contact: sourabh@sourabhbajaj.com
@summary: EventProfiler

 N/A numpy np N/A matplotlib.pyplot plt N/A QSTK.qstkutil.DataAccess da N/A QSTK.qstkutil.tsutil tsu N/A QSTK.qstkutil.qsdateutil du eventprofiler N/A N/A df_events_arg d_data i_lookback i_lookforward s_filename b_market_neutral b_errorbars s_market_sym N/A 20 20 study True True SPY N/A N/A  Event Profiler for an event matix N/A df_close N/A N/A N/A d_data N/A close copy N/A df_rets N/A N/A df_close copy N/A df_events N/A N/A df_events_arg copy N/A N/A N/A tsu returnize0 N/A df_rets values N/A N/A b_market_neutral True N/A N/A df_rets N/A df_rets N/A df_rets N/A s_market_sym N/A N/A df_rets N/A s_market_sym N/A N/A df_events N/A s_market_sym N/A df_close N/A N/A df_close reindex columns N/A df_events columns N/A N/A N/A df_events values N/A N/A 0 i_lookback N/A N/A np NaN N/A N/A N/A df_events values N/A N/A N/A i_lookforward N/A N/A np NaN N/A i_no_events N/A int N/A N/A N/A N/A np logical_not N/A N/A np isnan N/A df_events values sum N/A N/A i_no_events 0 Zero events in the event matrix N/A na_event_rets False N/A N/A i s_sym N/A enumerate N/A df_events columns N/A N/A N/A j dt_date N/A enumerate N/A df_events index N/A N/A N/A N/A N/A df_events N/A s_sym N/A dt_date 1 N/A N/A na_ret N/A N/A df_rets N/A s_sym N/A N/A j i_lookback N/A N/A j 1 i_lookforward N/A N/A N/A type na_event_rets N/A type N/A N/A na_event_rets na_ret N/A N/A na_event_rets N/A N/A np vstack N/A na_event_rets na_ret N/A N/A N/A len N/A na_event_rets shape 1 N/A N/A na_event_rets N/A N/A np expand_dims na_event_rets axis 0 N/A na_event_rets N/A N/A np cumprod N/A na_event_rets 1 axis 1 N/A na_event_rets N/A N/A N/A na_event_rets T N/A na_event_rets N/A N/A N/A i_lookback T N/A na_mean N/A N/A np mean na_event_rets axis 0 N/A na_std N/A N/A np std na_event_rets axis 0 N/A li_time N/A range N/A i_lookback N/A i_lookforward 1 N/A N/A N/A plt clf N/A N/A N/A plt axhline y 1.0 xmin N/A i_lookback xmax i_lookforward color k N/A N/A b_errorbars True N/A N/A N/A N/A plt errorbar N/A li_time N/A i_lookback N/A na_mean N/A i_lookback yerr N/A na_std N/A i_lookback ecolor #AAAAFF alpha 0.7 N/A N/A N/A plt plot li_time na_mean linewidth 3 label mean color b N/A N/A N/A plt xlim N/A N/A i_lookback 1 N/A i_lookforward 1 N/A N/A b_market_neutral True N/A N/A N/A N/A plt title N/A N/A Market Relative mean return of  N/A str i_no_events  events N/A N/A N/A N/A plt title N/A N/A Mean return of  N/A str i_no_events  events N/A N/A N/A plt xlabel Days N/A N/A N/A plt ylabel Cumulative Returns N/A N/A N/A plt savefig s_filename format pdf N/A