Case Study
Investigation of basic Black-Scholes Model
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)
3M Company
American Express
Amgen Inc.
Amazon.com Inc.
Apple Inc.
Boeing Company
Caterpillar Inc.
Chevron Corporation
Cisco Systems Inc.
Coca-Cola Company
Walt Disney Company
Goldman Sachs Group
Home Depot Inc.
Honeywell International
International Business Machines
Johnson & Johnson
JPMorgan Chase & Co.
McDonald's Corporation
Merck & Co. Inc.
Microsoft Corporation
Nike Inc.
Nvidia Corporation
Procter & Gamble Company
Salesforce Inc.
Sherwin-Williams Company
Travelers Companies Inc.
UnitedHealth Group Inc.
Verizon Communications Inc.
Visa Inc.
Walmart Inc.
FTSE 100 (100 stocks)
Airtel Africa
Anglo American
Associated British Foods
Admiral Group
Ashtead Group
Allwyn Entertainment
Antofagasta
Auto Trader Group
Aviva
AstraZeneca
BAE Systems
Babcock International
Barclays
British American Tobacco
Beazley
Berkeley Group
Bunzl
BP
BT Group
British Land
Coca-Cola Europacific Partners
Coca-Cola HBC
Centrica
Compass Group
Croda International
Convatec Group
DCC
Diageo
Diploma
Endeavour Mining
Entain
Experian
easyJet
F&C Investment Trust
Fresnillo
Games Workshop
Glencore
GSK
Hikma Pharmaceuticals
Halma
Haleon
HSBC Holdings
Hiscox
Howden Joinery
International Consolidated Airlines
Intermediate Capital Group
InterContinental Hotels Group
3i Group
Imperial Brands
IMI
Informa
Intertek Group
JD Sports Fashion
Kingfisher
Land Securities Group
Legal & General Group
Lloyds Banking Group
LondonMetric Property
London Stock Exchange Group
Marks & Spencer Group
Mondi
M&G
Melrose Industries
National Grid
NatWest Group
Next
PureTech Health
Phoenix Group
Prudential
Pershing Square Holdings
Persimmon
Pearson
RELX
Rio Tinto
Reckitt Benckiser Group
Rightmove
Rolls-Royce Holdings
Rentokil Initial
Sainsbury's
Schroders
Sage Group
Segro
Shell
Smiths Group
Scottish Mortgage Investment Trust
Smith & Nephew
Spirax-Sarco Engineering
SSE
Standard Chartered
St. James's Place
Severn Trent
Tesco
Taylor Wimpey
Unilever
United Utilities Group
United Utilities
Vodafone Group
Weir Group
WPP
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%
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