Skip to content

Vipeen21/Quant-finance

Repository files navigation

📈 Quantitative Finance & Stochastic Calculus Engine

GitHub follow GitHub stars GitHub forks GitHub license

Python NumPy SciPy Pandas Jupyter Notebook

This repository bridges the gap between high-level stochastic calculus theory and practical computational execution. It features interactive implementations covering everything from classical risk-neutral pricing frameworks to complex, non-constant volatility regimes and mathematical integration foundations.


🏗️ Engine Architecture & Mathematical Workflow

The core framework decouples foundational stochastic calculus elements from numerical layers and empirical calibration matrices to map complex asset profiles dynamically.

graph TD
    %% Custom styling definitions for readability
    classDef mainHeading fill:#1A5276,stroke:#113A54,stroke-width:2px,color:#FFFFFF,font-weight:bold,font-family:Arial,padding:12px;
    classDef primaryBlock fill:#2E4053,stroke:#1C2833,stroke-width:2px,color:#FFFFFF,font-weight:bold,font-family:Arial,padding:10px;
    classDef modelBlock fill:#EAECEE,stroke:#95A5A6,stroke-width:1.5px,color:#1C2833,font-weight:bold,font-family:Arial,padding:10px;
    classDef calibrationBlock fill:#D35400,stroke:#A04000,stroke-width:2px,color:#FFFFFF,font-weight:bold,font-family:Arial,padding:12px;
    classDef riskBlock fill:#196F3D,stroke:#114B29,stroke-width:2px,color:#FFFFFF,font-weight:bold,font-family:Arial,padding:12px;

    %% Global link styling for high contrast lines
    linkStyle default stroke:#566573,stroke-width:2px;

    %% Nodes and Assignments
    A[Stochastic Foundations:<br>Ito & SDEs]:::mainHeading
    B[Pricing Engine Frameworks]:::primaryBlock
    C[Analytical:<br>Black-Scholes]:::modelBlock
    D[Stochastic Volatility:<br>Heston Model]:::modelBlock
    E[Numerical:<br>Finite Difference Mesh]:::modelBlock
    F[Calibration Layer:<br>Market Implied Vol Surfaces]:::calibrationBlock
    G[Dynamic Risk Mitigation &<br>Volatility Analysis]:::riskBlock

    %% Flow/Connections
    A --> B
    B --> C
    B --> D
    B --> E
    D --> F
    E --> F
    F --> G
Loading

🎯 Core Frameworks Breakdown

1. Stochastic Volatility & The Heston Model

Real-world asset returns exhibit volatility clustering and leverage effects that classical constant-volatility frameworks fail to capture. This engine models asset dynamics via two coupled Stochastic Differential Equations (SDEs):

$$dS_t = \mu S_t dt + \sqrt{\nu_t} S_t dW_{1,t}$$

$$d\nu_t = \kappa(\theta - \nu_t) dt + \sigma \sqrt{\nu_t} dW_{2,t}$$

  • Calibration Layer: Mathematically fits structural parameters ($\kappa, \theta, \sigma, \rho$) to empirical market option chains.
  • Pricing Engine: Evaluates the characteristic function via Fourier inversions to value European derivatives under non-constant volatility.

2. Implied Volatility Surfaces & Numerical Discretization

  • Volatility Surfaces: Generates dynamic, multi-dimensional structures mapping the continuous implied volatility smile and skew across varying strikes and maturities.
  • Finite Difference Methods: Complements analytical equations by numerically solving pricing Partial Differential Equations (PDEs) under discrete boundary conditions.

📊 Comparative Framework Analysis

Model Framework Volatility Assumption Solution Method Key Strength Ideal Use-Case
Black-Scholes Constant $\sigma$ Analytical (Closed-form) Speed & benchmark stability Plain-vanilla liquid options
Heston Model Stochastic $\nu_t$ (CIR Process) Semi-Analytical (Fourier) Captures smile, skew & leverage Long-dated options, exotic profiles
Finite Differences Flexible / Arbitrary Numerical (Grid/Mesh) Handles path-dependence & barriers American options, custom boundaries

📂 Repository Blueprint

├── getting_started_tutorials/     # Foundational concepts & entry points
├── Black-ScholesTrading.ipynb     # Closed-form pricing & basic Greeks infrastructure
├── Heston Pricing 1.ipynb         # SDE setup and characteristic function solving
├── Heston Pricing 2.ipynb         # Fourier inversions and parameters calibration
├── finite_differences_option_pricing.ipynb # PDE numerical mesh methods
├── the_implied_volatility_surface.ipynb    # 3D mapping of skew and smile curves
├── ito_integration.ipynb          # Computational notebooks on Ito's Integral
├── itos_lemma.ipynb               # Structural expansions of stochastic variables
├── market implied volatility.py   # Real-time asset implied volatility extraction
├── risk free option trading.py    # Arbitrage boundary verification scripts
└── LICENSE                        # Open-source distribution permissions

🗺️ Future Roadmap & Expansion Work

  • Implement core Ito Calculus & SDE simulation environments.
  • Build semi-analytical closed-form frameworks (Black-Scholes, Heston).
  • Launch 3D Implied Volatility Surface mapping toolsets.
  • Phase 4: Neural Volatility Operators: Integrate Physics-Informed Neural Networks (PINNs) to accelerate option PDE grid solving under tight latency limits.
  • Phase 5: Rough Volatility Frameworks: Implement fractional Brownian motion (e.g., Rough Heston, rBergomi) to address structural micro-market irregularities.
  • Phase 6: Advanced Calibration Optimization: Deploy hybrid genetic-gradient algorithms to resolve non-convex objective spaces during Heston parameter fitting.

🤝 Community & Contribution

Whether you are looking to fix a mathematical edge-case, optimize a matrix calculation in NumPy, or add a new stochastic asset path generator, contributions are highly welcome!

  1. Fork the project repository.
  2. Create your feature branch (git checkout -b feature/StochasticUpgrade).
  3. Commit your changes (git commit -m 'Add neural network calibration layer').
  4. Push to the branch (git push origin feature/StochasticUpgrade).
  5. Open a Pull Request.

🙏 Connect & Collaborate

If this repository assists your quantitative research, trading strategy formulation, or stochastic calculus foundations, consider giving it a star!⭐ Star This Repo | 🍴 Fork This Repo

Vipeen Kumar Quantitative Researcher & Data Scientist

Let's collaborate on quantitative finance, stochastic systems, and financial AI architecture.

#QuantitativeFinance #StochasticCalculus #HestonModel #AlgorithmicTrading #VolatilitySurface #OptionsPricing

About

Here you will find complex Quantitative Finance topics like Implied Volatility Surface, Stochastic Volatility Model (Heston), Black-Scholes, Risk-neutral Pricing etc.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors