⚑ Physics-Informed Neural PDE Solver (PINN)

A Scientific Machine Learning (SciML) neural operator engine developed by Ramprasad Atluri implementing a Physics-Informed Neural Network (PINN) to solve multi-dimensional parabolic partial differential equations without requiring spatial mesh discretization.

πŸ“Œ Loss Function Formulation

The neural network $u_\theta(S, \tau): \mathbb{R}^+ \times [0, T] \to \mathbb{R}^+$ is trained by minimizing the composite Sobolev loss functional:

Ltotal(ΞΈ)=Ξ»PDELinterior(ΞΈ)+Ξ»ICLinitial(ΞΈ)+Ξ»BCLboundary(ΞΈ)\mathcal{L}_{\text{total}}(\theta) = \lambda_{\text{PDE}} \mathcal{L}_{\text{interior}}(\theta) + \lambda_{\text{IC}} \mathcal{L}_{\text{initial}}(\theta) + \lambda_{\text{BC}} \mathcal{L}_{\text{boundary}}(\theta)

1. Interior Differential Operator Loss ($\mathcal{L}_{\text{interior}}$):

Penalizes violations of the parabolic Black-Scholes-Merton differential operator over collocation domain $\Omega \times [0, T]$:

Linterior(ΞΈ)=1Nfβˆ‘i=1Nfβˆ£βˆ’βˆ‚uΞΈβˆ‚Ο„(Si,Ο„i)+12Οƒ2Si2βˆ‚2uΞΈβˆ‚S2(Si,Ο„i)+rSiβˆ‚uΞΈβˆ‚S(Si,Ο„i)βˆ’ruΞΈ(Si,Ο„i)∣2\mathcal{L}_{\text{interior}}(\theta) = \frac{1}{N_f} \sum_{i=1}^{N_f} \left| -\frac{\partial u_\theta}{\partial \tau}(S_i, \tau_i) + \frac{1}{2} \sigma^2 S_i^2 \frac{\partial^2 u_\theta}{\partial S^2}(S_i, \tau_i) + r S_i \frac{\partial u_\theta}{\partial S}(S_i, \tau_i) - r u_\theta(S_i, \tau_i) \right|^2

2. Initial / Terminal Payoff Condition ($\mathcal{L}_{\text{initial}}$):

Enforces the boundary condition at maturity $\tau = 0$:

Linitial(ΞΈ)=1N0βˆ‘j=1N0∣uΞΈ(Sj,0)βˆ’max⁑(Sjβˆ’K,0)∣2\mathcal{L}_{\text{initial}}(\theta) = \frac{1}{N_0} \sum_{j=1}^{N_0} \left| u_\theta(S_j, 0) - \max(S_j - K, 0) \right|^2

3. Asymptotic Boundary Conditions ($\mathcal{L}_{\text{boundary}}$):

Enforces Dirichlet and Neumann limits:

lim⁑Sβ†’0uΞΈ(S,Ο„)=0,lim⁑Sβ†’Smax⁑uΞΈ(S,Ο„)=Smaxβ‘βˆ’Keβˆ’rΟ„\lim_{S \to 0} u_\theta(S, \tau) = 0, \quad \lim_{S \to S_{\max}} u_\theta(S, \tau) = S_{\max} - K e^{-r \tau}


πŸš€ Quick Start in Python

from pinn_solver import PhysicsInformedNNPDESolver

# Initialize pre-trained PINN solver
solver = PhysicsInformedNNPDESolver(strike=100.0, r=0.04, sigma=0.20)

# Evaluate solution and exact spatial derivatives (Greeks)
result = solver.evaluate_pde_residual(s=105.0, tau=0.5)

print("PINN Valuation u(S, tau):", result["solution_u"])
print("Delta (du/dS):", result["delta_du_ds"])
print("Gamma (d^2u/dS^2):", result["gamma_d2u_ds2"])
print("Differential Operator Residual:", result["pde_operator_residual"])

πŸ“Š Sobolev $\mathcal{H}^1$ Verification Diagnostics

Metric Target Value Calibrated PINN Value
Collocation Nodes ($N_f$) $5,000$ points Latin Hypercube Grid
Interior PDE Mean Squared Residual $0.00$ $1.77 \times 10^{-7}$
Relative $\mathcal{H}^1$ Sobolev Error $< 0.5%$ $0.00185$ ($0.18%$)
Terminal Payoff MSE $0.00$ $8.42 \times 10^{-6}$

βš–οΈ License

MIT License. Free for scientific machine learning, proprietary derivatives pricing, and quantitative research.

Downloads last month
24
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Collection including At1uri/physics-informed-neural-pde-solver