β‘ 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:
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]$:
2. Initial / Terminal Payoff Condition ($\mathcal{L}_{\text{initial}}$):
Enforces the boundary condition at maturity $\tau = 0$:
3. Asymptotic Boundary Conditions ($\mathcal{L}_{\text{boundary}}$):
Enforces Dirichlet and Neumann limits:
π 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
Collection including At1uri/physics-informed-neural-pde-solver
Collection
Quantitative finance toolkit: time series, algorithmic backtesting, econometrics, financial NLP sentiment, and portfolio optimization. β’ 17 items β’ Updated β’ 1