Skip to content

Conversation

@iampratik13
Copy link
Contributor

This PR introduces an educational and well-documented implementation of the Black-Scholes-Merton model for European option pricing in R.

Overview
The implementation provides a comprehensive R6-based BlackScholesCalculator class that supports:

  • Call and Put option price calculations
  • Computation of Greeks (Delta, Gamma, Theta, Vega, Rho)
  • Implied volatility estimation via the Newton-Raphson method

Key Features

  • Modular and extensible R6 OOP design
  • Input validation for robustness
  • Clear financial and mathematical documentation
  • Example demonstration for reproducibility

Usage
Run demonstrate_black_scholes() to view the pricing results and Greeks for sample parameters.

Complexity

  • Time Complexity: O(1) for pricing and Greeks computation
  • Space Complexity: O(1)

This implementation enhances the repository’s finance module with a fundamental model widely used in quantitative finance and derivatives analysis.

@siriak siriak requested a review from Copilot October 12, 2025 09:43
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a comprehensive implementation of the Black-Scholes-Merton model for European option pricing in R. The implementation provides a modular R6-based calculator class that supports option pricing, Greeks computation, and implied volatility estimation.

Key changes:

  • Adds a complete BlackScholesCalculator R6 class with call/put pricing methods
  • Implements Greeks calculation (Delta, Gamma, Theta, Vega, Rho) for both call and put options
  • Includes implied volatility estimation using Newton-Raphson method with robust convergence handling

@siriak siriak merged commit 6d15d42 into TheAlgorithms:master Oct 12, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants