eventstudy.Single.__init__

Single.__init__(model_func, model_data: dict, event_window: tuple = (-10, 10), estimation_size: int = 300, buffer_size: int = 30, keep_model: bool = False, description: str = None, event_date: numpy.datetime64 = None)

Low-level (complex) way of runing an event study. Prefer the simpler use of model methods.

Parameters
  • model_func – Function computing the modelisation of returns.

  • model_data (dict) – Dictionary containing all parameters needed by model_func.

  • event_window (tuple, optional) – Event window specification (T2,T3), by default (-10, +10). A tuple of two integers, representing the start and the end of the event window. Classically, the event-window starts before the event and ends after the event. For example, event_window = (-2,+20) means that the event-period starts 2 periods before the event and ends 20 periods after.

  • estimation_size (int, optional) – Size of the estimation for the modelisation of returns [T0,T1], by default 300

  • buffer_size (int, optional) – Size of the buffer window [T1,T2], by default 30

  • keep_model (bool, optional) – If true the model used to compute the event study will be stored in memory. It will be accessible through the class attributes eventstudy.Single.model, by default False

Example

Run an event study based on : .. the market_model function defined in the models submodule, .. given values for security and market returns, .. and default parameters

>>> from eventstudy import Single, models
>>> event = Single(
...     models.market_model,
...     {'security_returns':[0.032,-0.043,...], 'market_returns':[0.012,-0.04,...]}
... )