Skip to main content

Event Studies Library

A Python package for performing financial event study analyses. This library provides tools to analyze the impact of events on security returns using various statistical models. This package is a heavily modified version of Jean-Baptiste Lemaire's eventstudy package (https://github.com/LemaireJean-Baptiste/eventstudy)

Overview

The general premise of event studies is to perform a regression analysis of some period prior to the event in question to establish a baseline equation that estimates the log returns of a single event and determines if the actual return is statistically significant compared to the prediction. This leads to an abnormal return value (AR), which is the return above the expected return (predicted value + prediction error from the regression from the prior period). The daily AR values are then summed over the event window to create a cumulative abnormal return value (CAR). A t-test statistic is generated over the event window for each day's CAR value, and the P-value is calculated for significance daily over the event window to determine if the CAR values have any statistical significance that indicates these values are indeed different from what was expected.

Single events as described above are then aggregated and analyzed using the same t-test and P-value methodologies to determine if the aggregate of all events of the same type are statistically significant. These values are referred to as the average abnormal return (AAR) and the cumulative average abnormal return (CAAR).

Installation

pip install ffjr-eventstudies

Or install from source:

git clone https://github.com/rla3rd/eventstudies.git
cd eventstudies
pip install -e .

Requirements

  • Python 3.10 or higher
  • numpy >= 1.26.0
  • pandas >= 2.2.3
  • scipy >= 1.12.0
  • statsmodels >= 0.14.0
  • matplotlib >= 3.8.0
  • seaborn >= 0.13.0
  • pandas_datareader >= 0.10.0 (for fetching market data)

Quick Start

import eventstudies as es
from eventstudies import SingleEvent, MultipleEvents
from eventstudies.util import create_returns_parquet
import numpy as np

# Option 1: Create returns parquet from pandas_datareader
create_returns_parquet(
    tickers=['AAPL', 'GOOGL', 'MSFT', 'SPY'],
    output_path='data/market/returns.parquet',
    start_date='2020-01-01',
    end_date='2023-12-31'
)
SingleEvent.import_returns(path='data/market/returns.parquet')

# Option 2: Import returns from existing file
# SingleEvent.import_returns('returns.csv')

# Import Fama-French factors
SingleEvent.import_FamaFrench()

# Run a single event study
event = SingleEvent.MarketModel(
    ticker='AAPL',
    mkt_idx='SPY',
    event_date=np.datetime64('2023-01-15'),
    event_window=(-5, +10),
    est_size=252,
    buffer_size=21
)

# Display results
print(event.results())
event.plot()

Available Models

This package provides the following event study models:

  • MeanAdjustedModel: The mean daily return is calculated for the est_size period. The AR value is daily returns minus the mean daily return. The CAR value is the cumulative sum of AR.

  • OrdinaryReturnsModel (RawReturnsModel): AR is just the security's daily returns. The CAR value is the cumulative sum of AR.

  • MarketAdjustedModel: The AR value is the daily returns minus daily returns of a given market index. The CAR value is the cumulative sum of AR.

  • MarketModel: An OLS regression is performed between a security's daily returns and the daily returns of a given market index over the est_size period. Alpha and beta are calculated from the regression. The AR value is the daily returns minus (predicted value of returns + std error of prediction) using the OLS regression results. The CAR value is the cumulative sum of AR.

  • FamaFrench3: An OLS regression is performed between a security's daily returns vs the Fama-French 3 factors over the est_size period. Alpha and beta are calculated from the regression. The AR value is the daily returns minus (predicted value of returns + std error of prediction) using the OLS regression results. The CAR value is the cumulative sum of AR.

  • Carhart: An OLS regression is performed between a security's daily returns vs the Carhart factors (FamaFrench3 + Momentum) over the est_size period. Alpha and beta are calculated from the regression. The AR value is the daily returns minus (predicted value of returns + std error of prediction) using the OLS regression results. The CAR value is the cumulative sum of AR.

  • FamaFrench5: An OLS regression is performed between a security's daily returns vs the Fama-French 5 factors over the est_size period. Alpha and beta are calculated from the regression. The AR value is the daily returns minus (predicted value of returns + std error of prediction) using the OLS regression results. The CAR value is the cumulative sum of AR.

Documentation

For detailed documentation, see the docs directory.

License

GNU General Public License v3 (GPLv3)

Author

Rick Albright
Jean-Baptiste Lemaire

Release files for ffjr-eventstudies 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ffjr-eventstudies 0.2.0
File Size Uploaded
ffjr_eventstudies-0.2.0.tar.gz 1.5 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for ffjr-eventstudies 0.2.0
File Interpreter ABI Platform
ffjr_eventstudies-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 1.5 MB

Release files / ffjr_eventstudies-0.2.0.tar.gz

Download URL ffjr_eventstudies-0.2.0.tar.gz
Size 1.5 MB
Tags Source
SHA-256 checksum
How to use checksums
038a9b3639f83d1e4850b9d7269a29db4a0b96fa7ab3b0812a06e022bdb05569
BLAKE2b-256 checksum
How to use checksums
6d44ecc1707edf65fe91fcdf4efbbd3a768924a5db974088229487e789c91185
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 14, 2026.

Transparency log

Release files / ffjr_eventstudies-0.2.0-py3-none-any.whl

Download URL ffjr_eventstudies-0.2.0-py3-none-any.whl
Size 43.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a8dde21ab68760135359ff6dea7c0c0c24fdd87f7de30465362aeb22bb1fdddd
BLAKE2b-256 checksum
How to use checksums
7abf2692c148462e5dbf755aeda70f970e12c9a0c4193dca2a51e2f179daf366
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 14, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page