Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Betting Against Beta (BAB) Replication

Python License Status

Overview

This repository implements a systematic equity strategy replicating the Betting Against Beta (BAB) factor, famously documented by Frazzini & Pedersen (2013).

The strategy challenges the core CAPM assumption that higher risk (beta) equals higher return. Instead, it exploits the low-beta anomaly by constructing a leverage-neutral portfolio that is:

  1. Long Low-Beta assets (Leveraged to match market risk).
  2. Short High-Beta assets (De-leveraged to match market risk).

The Quant Logic

Standard CAPM implies $E[R_i] = R_f + \beta_i(E[R_m] - R_f)$. However, constrained investors bid up high-beta assets, lowering their alpha. This project replicates the BAB factor using the following portfolio construction:

1. Rolling Beta Estimation

Betas are calculated using a 12-month rolling window against the SPY benchmark: $$\beta_i^{TS} = \frac{Cov(r_i, r_m)}{\sigma_m^2}$$

2. Leverage Neutrality

To make the strategy market-neutral in terms of risk, we apply a leverage factor ($L$) to the low-beta leg: $$L = \frac{\beta_{High}}{\beta_{Low}}$$ This ensures the long leg has the same volatility exposure as the short leg.

3. Friction Modeling

The backtest accounts for real-world frictions:

  • Borrowing Costs: Applied to the leveraged long leg.
  • Transaction Costs: Applied to turnover on rebalancing.

Tech Stack

  • Python: Core logic and data processing.
  • Pandas/NumPy: Vectorized timeseries operations.
  • Statsmodels: Rolling covariance and regression metrics.
  • YFinance: Data ingestion (CRSP/Compustat proxy).

Performance Metrics

The system outputs a tear sheet including:

  • Sharpe Ratio

  • Maximum Drawdown

  • Annualized Volatility

  • Average Leverage Ratio required to maintain beta-neutrality.

Disclaimer

Not Financial Advice. This project is for educational and research purposes only. Past performance of the strategy does not guarantee future results. The code is provided "as is" without warranty of any kind.

About

A Python implementation of Frazzini & Pedersen’s (2013) Betting Against Beta (BAB) factor, featuring leverage-constrained portfolio construction and transaction cost analysis.

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages