Case Study

Investigation of basic Black-Scholes Model

Research & Data Analysis2024

Investigation of basic Black-Scholes Model

Overview

This project involved investigating the Black-Scholes model by predicting option prices using the Black-Scholes equation. The Black-Scholes model is a mathematical framework used to determine the theoretical price of European-style options. The goal was to implement the model, collect real option chain data, and compare predicted prices against actual market prices to evaluate the model's accuracy and performance.

Objectives

  • Implement the Black-Scholes call option pricing formula
  • Collect option chain data for multiple tickers from financial markets
  • Calculate predicted option prices using the Black-Scholes model
  • Compare predicted prices against actual market prices (last traded prices)
  • Visualize the relationship between predicted and actual prices
  • Evaluate model accuracy and identify areas for improvement

Methodology

The project utilized the Black-Scholes-Merton option pricing model with the following approach:

  • Data Collection: Downloaded option chain data for multiple tickers using yfinance, including call options with strike prices, expiration dates, implied volatility, and market prices
  • Black-Scholes Implementation: Implemented the Black-Scholes call option pricing formula:
    C = S0N(d1) - Xe-rTN(d2)
    where d1 =[ln(S0/X) + (r + σ2/2)T] / (σT)
    and d2 = d1 - σT
  • Parameters Used: Current stock price (S), strike price (X), time to maturity (T), risk-free rate (r = 4.19%), and implied volatility (σ)
  • Price Prediction: Calculated theoretical option prices for all call options in the dataset
  • Comparison Analysis: Compared predicted prices against last traded prices to evaluate model accuracy
  • Visualization: Created scatter plots to visualize the relationship between predicted and actual prices

Stock Tickers Used

The analysis was performed on option chain data from major stock indices, including the Dow Jones Industrial Average (DJIA) and the FTSE 100. The following tickers were included in the dataset:

Dow Jones Industrial Average (30 stocks)

MMM

3M Company

AXP

American Express

AMGN

Amgen Inc.

AMZN

Amazon.com Inc.

AAPL

Apple Inc.

BA

Boeing Company

CAT

Caterpillar Inc.

CVX

Chevron Corporation

CSCO

Cisco Systems Inc.

KO

Coca-Cola Company

DIS

Walt Disney Company

GS

Goldman Sachs Group

HD

Home Depot Inc.

HON

Honeywell International

IBM

International Business Machines

JNJ

Johnson & Johnson

JPM

JPMorgan Chase & Co.

MCD

McDonald's Corporation

MRK

Merck & Co. Inc.

MSFT

Microsoft Corporation

NKE

Nike Inc.

NVDA

Nvidia Corporation

PG

Procter & Gamble Company

CRM

Salesforce Inc.

SHW

Sherwin-Williams Company

TRV

Travelers Companies Inc.

UNH

UnitedHealth Group Inc.

VZ

Verizon Communications Inc.

V

Visa Inc.

WMT

Walmart Inc.

FTSE 100 (100 stocks)

AAF.L

Airtel Africa

AAL.L

Anglo American

ABF.L

Associated British Foods

ADM.L

Admiral Group

AHT.L

Ashtead Group

ALW.L

Allwyn Entertainment

ANTO.L

Antofagasta

AUTO.L

Auto Trader Group

AV.L

Aviva

AZN.L

AstraZeneca

BA.L

BAE Systems

BAB.L

Babcock International

BARC.L

Barclays

BATS.L

British American Tobacco

BEZ.L

Beazley

BKG.L

Berkeley Group

BNZL.L

Bunzl

BP.L

BP

BT-A.L

BT Group

BTRW.L

British Land

CCEP.L

Coca-Cola Europacific Partners

CCH.L

Coca-Cola HBC

CNA.L

Centrica

CPG.L

Compass Group

CRDA.L

Croda International

CTEC.L

Convatec Group

DCC.L

DCC

DGE.L

Diageo

DPLM.L

Diploma

EDV.L

Endeavour Mining

ENT.L

Entain

EXPN.L

Experian

EZJ.L

easyJet

FCIT.L

F&C Investment Trust

FRES.L

Fresnillo

GAW.L

Games Workshop

GLEN.L

Glencore

GSK.L

GSK

HIK.L

Hikma Pharmaceuticals

HLMA.L

Halma

HLN.L

Haleon

HSBA.L

HSBC Holdings

HSX.L

Hiscox

HWDN.L

Howden Joinery

IAG.L

International Consolidated Airlines

ICG.L

Intermediate Capital Group

IHG.L

InterContinental Hotels Group

III.L

3i Group

IMB.L

Imperial Brands

IMI.L

IMI

INF.L

Informa

ITRK.L

Intertek Group

JD.L

JD Sports Fashion

KGF.L

Kingfisher

LAND.L

Land Securities Group

LGEN.L

Legal & General Group

LLOY.L

Lloyds Banking Group

LMP.L

LondonMetric Property

LSEG.L

London Stock Exchange Group

MKS.L

Marks & Spencer Group

MNDI.L

Mondi

MNG.L

M&G

MRO.L

Melrose Industries

NG.L

National Grid

NWG.L

NatWest Group

NXT.L

Next

PCT.L

PureTech Health

PHNX.L

Phoenix Group

PRU.L

Prudential

PSH.L

Pershing Square Holdings

PSN.L

Persimmon

PSON.L

Pearson

REL.L

RELX

RIO.L

Rio Tinto

RKT.L

Reckitt Benckiser Group

RMV.L

Rightmove

RR.L

Rolls-Royce Holdings

RTO.L

Rentokil Initial

SBRY.L

Sainsbury's

SDR.L

Schroders

SGE.L

Sage Group

SGRO.L

Segro

SHEL.L

Shell

SMIN.L

Smiths Group

SMT.L

Scottish Mortgage Investment Trust

SN.L

Smith & Nephew

SPX.L

Spirax-Sarco Engineering

SSE.L

SSE

STAN.L

Standard Chartered

STJ.L

St. James's Place

SVT.L

Severn Trent

TSCO.L

Tesco

TW.L

Taylor Wimpey

ULVR.L

Unilever

UTG.L

United Utilities Group

UU.L

United Utilities

VOD.L

Vodafone Group

WEIR.L

Weir Group

WPP.L

WPP

WTB.L

Whitbread

Data Source:

Option chain data was downloaded using the yfinance library, which provides access to real-time and historical market data from Yahoo Finance. The data includes call options with strike prices, expiration dates, implied volatility, and market prices for each ticker.

Implementation & Results

The Black-Scholes model was successfully implemented and applied to option chain data. Below is an interactive visualization showing the predicted call option prices versus the last traded market prices:

Model Performance Statistics

Data Points

200

Mean Error

4.07%

Max Error

100.00%

Min Error

0.00%

Loading chart...

Note:

This visualization demonstrates the Black-Scholes model's predicted call option prices compared to market prices. The dashed red line represents perfect prediction (y=x). Data points closer to this line indicate better model accuracy. The model uses a risk-free rate of 4.19% and incorporates implied volatility from option chains.

Challenges & Solutions

Challenge: Numerical Stability in Calculations

The Black-Scholes formula involves logarithmic and exponential calculations that can lead to numerical instability, especially with extreme values or very short time to maturity.

Solution: Added small epsilon values (1e-12) to volatility to prevent division by zero, and implemented robust error handling for edge cases in the normal cumulative distribution function.

Challenge: Data Quality and Missing Values

Option chain data may contain missing values, infinite values, or invalid entries that need to be filtered before analysis.

Solution: Implemented data cleaning procedures to replace infinite values with NaN, drop rows with missing critical data, and validate all numerical inputs before calculations.

Challenge: Model Assumptions vs. Market Reality

The Black-Scholes model makes several assumptions (constant volatility, no dividends, European options) that may not hold in real markets, leading to prediction errors.

Solution: Used implied volatility from market data rather than historical volatility, and analyzed the distribution of prediction errors to understand model limitations.

Results & Outcomes

The project successfully implemented and evaluated the Black-Scholes model with the following achievements:

  • Successfully implemented the Black-Scholes call option pricing formula in Python and converted to React/TypeScript
  • Processed option chain data for multiple tickers, calculating predicted prices for hundreds of options
  • Created interactive visualizations comparing predicted vs. actual market prices
  • Identified model performance characteristics and areas where predictions align closely with market prices
  • Demonstrated understanding of financial mathematics, option pricing theory, and data analysis
  • Built a reusable component that can be integrated into web applications for option pricing analysis

Key Learnings

This project provided valuable insights into financial mathematics and option pricing:

  • Deepened understanding of the Black-Scholes-Merton model and its mathematical foundations
  • Learned to work with real financial data APIs and process option chain datasets
  • Gained experience in implementing complex mathematical formulas with numerical stability considerations
  • Understood the importance of model assumptions and their impact on prediction accuracy
  • Developed skills in data visualization for financial analysis and model evaluation
  • Learned to convert Python-based financial models into web-based interactive components