Black-Scholes 1D – European call¶
| Example | |
|---|---|
| Source | DeepXDE example |
| Problem | Forward |
| Dimension | 1D (x, t) |
| Regime | Time-dependent |
| Geometry | Interval |
| Outputs | u |
| Settings | Default (no separate Tuned preset) |
Governing equations¶
Mathematical form (from the benchmark records):
As typed in PINNStudio's Equations page (each expression is a residual, set to zero):
Constants: K = 50, r = 0.05, sigma = 0.2
Domain¶
- Interval: \(x \in [0, 150]\)
- Time interval: \(t \in [0, 1]\)
Initial conditions¶
| Output | Initial value | How it is imposed (Settings: Default) |
|---|---|---|
u |
np.maximum(x - K, 0) |
loss term |
Boundary conditions¶
| Type | Where | Output | Value | Details |
|---|---|---|---|---|
| Dirichlet BC | left |
u |
0 |
— |
| Dirichlet BC | right |
u |
x_max - K*exp(-r*t) |
— |
Settings¶
Settings: Default — DeepXDE's own settings
- Network: FNN, hidden layers 4 × 28, inputs (x, t), 1 output; activation tanh, initializer Glorot normal
- Points: 2,047 domain, 63 boundary, 127 initial, 2,047 test
- Loss weights:
1,1,1,1(equations, then boundary-condition rows, then initial conditions)
| Phase | Optimizer | Iterations | Learning rate | Decay |
|---|---|---|---|---|
| 1 | Adam | 20,000 | 0.001 | none |
| 2 | L-BFGS | 15,000 | — | none |
No separate Tuned preset: the Tuned item is greyed out for this example (its Default settings are PINNStudio's best).
Results¶
The configuration selected in PINNStudio's benchmark study, run on one RTX 4090. Forward: relative L₂ error of each output at the last reference time. Inverse: each parameter's relative error and, per seed, the largest of them (worst parameter error).
Forward problem¶
Settings: Default — the example's own settings (not in the tuning sweep); the example has no separate Tuned preset for this mode. Values: median over seeds 2026, 1, 2.
| Output | Relative L₂ |
|---|---|
| u | 4.3 × 10⁻⁴ |
Full benchmark record: every setting tried, the per-seed values and all figures are in the benchmark records on GitHub.
Loading it in PINNStudio¶
- Forward: toolbar Examples: › Forward › under the ── 1D ── heading, Black-Scholes 1D – European call › Default, then Solve.
Loading an example fills in every setting; anything you change before Solve is listed in the Training Log. Your save folder, GPU, random-seed and plot-style settings are kept.
Reference solution¶
- Exact solution, Error Analysis › reference from formula:
u = np.maximum(x, 1e-10)*norm_cdf((log(np.maximum(x, 1e-10)/K) + (r + sigma**2/2)*np.maximum(t, 1e-8))/(sigma*sqrt(np.maximum(t, 1e-8)))) - K*exp(-r*np.maximum(t, 1e-8))*norm_cdf((log(np.maximum(x, 1e-10)/K) + (r + sigma**2/2)*np.maximum(t, 1e-8))/(sigma*sqrt(np.maximum(t, 1e-8))) - sigma*sqrt(np.maximum(t, 1e-8)))
Notes¶
- x is the stock price S in [0, 150] and t the time to maturity tau; strike K, rate r and volatility sigma are constants.
Definition and records¶
- Definition:
EXAMPLESentry "Black-Scholes equation (call option)" inpinnstudio/core/deepxde_examples.py - Equations: Governing equations on this page
- Reference data: the exact-solution formula under Reference solution (no data files)
- Benchmark records:
benchmarks/problems/black-scholes-1d-european-call.md, its entry in the examples overview, the benchmark collection - Tuning-study configurations (records of the tuning study; open one with Problem › Open Saved Problem...; not presets of the Examples list):
Black-Scholes 1D – European call (tuned).pinn.json - DeepXDE example: black_scholes_call.py (documentation)
- Cite: Lu et al. 2021 (DeepXDE)
How the benchmark values were measured and checked: Reproducibility.