Event Profiler

From Quantwiki
Jump to: navigation, search

Event Profiler Introduction

QSTK's event study software allows a developer to describe market events, then observe, statistically, how those events affect future equity prices. The event profiler scans over historical data for specified event and then calculates the impact of that event on the equity prices in the past and the future over a certain lookback period.


EventProfiler.py

This is the main file the generates the study of particular events and saves the plot in a pdf file, The input to the file is a event Matrix which is described as shown below:

EventMatrix is a Pandas Datamatrix.

Date IBM GOOG XOM MSFT GS JP
(d1) nan nan 1 nan nan 1
(d2) nan 1 nan nan nan nan
(d3) 1 nan 1 nan 1 nan
(d4) nan 1 nan 1 nan nan

d1 = start date, nan = no information about any event, status bit(positively confirms the event occurence).

Other Inputs to the eventprofiler object are:

Lookback days which is assumed to be 20 by default.

Lookforward days which is also asssumed to be 20 by default.


Event Study

The study function in the event profiler class, plots the average of market neutral cumulative returns, along with error bars. The X-axis is the relative time frame from -lookback days to lookforward days size of error bar on each side of the mean value on the I th day is absolute value of (mean @ I - standard deviation @ I).

eventProfiler = ep.EventProfiler(eventMatrix,startday,endday,lookback_days=20,lookforward_days=20,verbose=True)
eventProfiler.study(filename="MyEventStudy.pdf",plotErrorBars=True,plotMarketNeutral=True,plotEvents=False,marketSymbol='SPY')

We can set all the parameters taken by the study function. The above mentioned code shows how to create an event study. The eventmatrix has to be generated separately.


Using the Event Profiler


Information about the usage of the Event Profiler and creating the event matrix for the class can be found in QSTK_Tutorial_9 which talks in detail about this.

Personal tools