Monte Carlo replication scaffold for efficient SABR simulation.
Project description
SABR Simulation Paper Replication
This workspace contains a Python replication scaffold for:
Choi, Hu, Kwok, "Efficient and accurate simulation of the stochastic-alpha-beta-rho model"
The current scaffold focuses on reproducing the paper's core Monte Carlo machinery:
- Algorithm 1: shifted-lognormal sampling of conditional integrated variance
- Algorithm 2: martingale-preserving CEV approximation for the conditional forward
- Algorithm 3: exact sampling of a CEV transition via a shifted-Poisson mixture gamma law
- Algorithm 4: full SABR terminal simulation over a time grid
Presentation overview
The paper studies efficient Monte Carlo simulation of the SABR model
dF_t = \sigma_t F_t^\beta\,dW_t,\qquad
\frac{d\sigma_t}{\sigma_t} = \nu\,dZ_t,\qquad
dW_t\,dZ_t = \rho\,dt.
The volatility step is sampled exactly:
\sigma_{t+h}
=
\sigma_t
\exp\left(\nu\sqrt{h}\,X_\sigma-\frac{1}{2}\nu^2h\right),
\qquad X_\sigma\sim N(0,1).
The first difficult quantity is the normalized conditional average variance
I_t^h
=
\frac{1}{\sigma_t^2h}
\int_t^{t+h}\sigma_s^2\,ds
\;\Bigg|\;\sigma_{t+h}.
Algorithm 1 approximates this with a shifted lognormal random variable:
I_t^h
\approx
\mu
\left[
\frac{1}{6}
+
\frac{5}{6}
\exp\left(aX-\frac{1}{2}a^2\right)
\right],
\qquad X\sim N(0,1),
where
\mu=\mathbb{E}[I_t^h\mid\sigma_{t+h}],\qquad
a=\sqrt{\log\left(1+\frac{36}{25}v^2\right)},\qquad
v=
\frac{\sqrt{\mathrm{Var}(I_t^h\mid\sigma_{t+h})}}
{\mathbb{E}[I_t^h\mid\sigma_{t+h}]}.
The second difficult quantity is the conditional forward price. For 0 < beta < 1, Algorithm 2 uses a martingale-preserving CEV approximation:
F_{t+h}\mid\sigma_{t+h},I_t^h
\approx
\mathrm{CEV}_\beta
\left(
\bar F_t^h,
(\rho^*)^2\sigma_t^2hI_t^h
\right),
\qquad
\rho^*=\sqrt{1-\rho^2},
with conditional mean
\bar F_t^h
=
F_t
\exp\left(
\frac{\rho(\sigma_{t+h}-\sigma_t)}{\nu F_t^{1-\beta}}
-
\frac{\rho^2\sigma_t^2hI_t^h}{2F_t^{2(1-\beta)}}
\right).
This choice is designed so that the forward process remains close to a martingale:
\mathbb{E}[F_{t+h}]\approx F_t.
Algorithm 3 then samples the CEV transition exactly using a Gamma-Poisson-Gamma construction. Algorithm 4 combines the steps: exact volatility step, shifted-lognormal average variance, martingale-preserving CEV approximation, exact CEV sampling, and repetition over the full time grid.
Files
sabr_replicate.py: core implementationrun_experiments.py: CLI entrypoint for tables, figures, and validationnotebooks/paper_reproduction_walkthrough.ipynb: presentation-oriented walkthrough with formulas, sanity checks, paper tables, figure datasets, and validationnotebooks/replication_sanity_checks.ipynb: notebook with model-level sanity checks and validation summariesrequirements.txt: lightweight dependency list for the replication environmentnotebooks/asian_option_extension.ipynb: path-dependent extension notebook that uses the replicated SABR Monte Carlo simulator to price arithmetic-average Asian call options and compare them with European calls.
What is implemented
- Exact volatility stepping
- PyFeng-backed conditional moment formulas for the normalized integrated variance
- PyFeng-backed shifted-lognormal parameter fitting with fixed shift
lambda = 5/6 - Exact CEV sampling for
0 < beta < 1 - Special handling for
beta = 1and|rho| = 1 - European call pricing from Monte Carlo samples
- Arithmetic-average Asian call extension using the replicated SABR Monte Carlo path simulation
- Table 3 parameter presets as named cases
- Direct experiment entrypoints for Tables 1, 2, 4, 5, 6, 7
- Figure 1 moment-comparison dataset
- Figure 2 / Table 7 convergence dataset
- Figure 3 comparison dataset between the paper scheme and Islah's approximation
- PyFeng analytic approximation rows where the package already provides them, plus paper-reference rows for the remaining baselines
- Group 16 ADI finite-difference benchmark integration through the
mafn-finite-differencepackage, with explicit domain settings for stressed SABR cases - CLI support for switching benchmark sources with
--benchmark-source paper|fdm|mc|none - A regression test covering the
rho = 1Islah edge case - A notebook with extra sanity checks outside the paper tables:
nu = 0CEV limitbeta = 1, nu = 0Black-Scholes limit- martingale checks across maturities
|rho| = 1Islah stability- quick validation summary
What is not implemented yet
- Direct reimplementation of competing baselines such as Euler, low-bias, PSE, Hagan, ZC Map, or Hyb ZC Map
- Variance reduction and full performance tuning
Current status
Paper-scale validation with the ADI-FD benchmark currently reports:
- overall conclusion:
Implementation consistent with paper - replication conclusion:
Replication likely successful - martingale test: noise-dominated with no evidence of systematic drift
- Table 2:
PASS - Table 1:
WARNING, with a small residual discrepancy (max relative error about0.43%)
This means the main replication target now looks successful, while Table 1 still shows a mild benchmark-level gap worth documenting.
Run
Install the small dependency set first:
python -m pip install -r .\requirements.txt
Then run the CLI:
python .\run_experiments.py --experiment table1 --paper-scale
python .\run_experiments.py --experiment table1 --paper-scale --benchmark-source fdm
python .\run_experiments.py --experiment table4 --paper-scale
python .\run_experiments.py --experiment table7 --n-paths 20000 --repeats 3 --benchmark-source fdm
python .\run_experiments.py --experiment figure3 --n-paths 50000 --repeats 5 --benchmark-source fdm
python .\run_experiments.py --experiment validate --quick --benchmark-source fdm
You can also save any tabular output:
python .\run_experiments.py --experiment table7 --output-csv .\outputs\table7.csv
Current paper-scale reproducibility commands:
python .\run_experiments.py --experiment table1 --paper-scale --benchmark-source fdm --output-csv .\outputs\table1_paper_scale_fdm.csv
python .\run_experiments.py --experiment table2 --paper-scale --benchmark-source fdm --output-csv .\outputs\table2_paper_scale_fdm.csv
python .\run_experiments.py --experiment validate --paper-scale --benchmark-source fdm --output-csv .\outputs\validation
pytest -q .\tests\test_islah_rho1.py
For an explanation-oriented walkthrough rather than a test log, open:
.\notebooks\paper_reproduction_walkthrough.ipynb
For a shorter sanity-check-only notebook, open:
.\notebooks\replication_sanity_checks.ipynb
For the path-dependent Asian option extension, open:
.\notebooks\asian_option_extension.ipynb
Notes
- The paper's formulas were transcribed from the PDF and implemented directly.
- We now rely on PyFENG for building blocks it already exposes well: conditional average-variance moments, shifted-lognormal moment fitting, and several analytic SABR approximation models.
- FDM benchmarks are delegated to Group 16's
mafn-finite-differencepackage, which implements a Douglas-scheme ADI SABR solver and cites von Sydow et al. (2010), "ADI finite difference schemes for option pricing in the Heston model with correlation." - When calling the Group 16 ADI pricer, this project passes wider default asset and volatility domains than the package defaults (
S_max = 8 * max(F0, K),v_max = max(10 * sigma0, 1)). This avoids upper-boundary truncation in long-maturity / high-vol-of-vol cases such as Table 7 / Figure 2 Case IV. - The project directly reproduces the paper's proposed simulation method. Several competing baseline rows are included from PyFeng or paper-reference values rather than being fully reimplemented from scratch.
--benchmark-source paperuses the tabulated paper benchmarks when they are available.--benchmark-source fdmrecomputes benchmark prices with Group 16's ADI finite-difference package.table7/figure3fall back to the internal high-resolution Monte Carlo benchmark unless--benchmark-source fdmis requested.- This is now a stronger reproduction scaffold with direct table/figure entrypoints and an external ADI-FD benchmark integration, but it is still not a finished paper-grade reproduction package.
- The saved validation CSVs are written as
validation_table1_df.csv,validation_table2_df.csv, andvalidation_martingale_df.csvinside the output directory. - The fastest path from here is:
- replace paper-reference baseline rows with actual baseline implementations,
- tune variance reduction and runtime for paper-scale sweeps,
- compare the new PDE benchmarks against an independent reference implementation.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sabr_replication_demo-0.1.0.tar.gz.
File metadata
- Download URL: sabr_replication_demo-0.1.0.tar.gz
- Upload date:
- Size: 25.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
17db648e851b7abd57a931662f2146df9c52a5d56e2e277c37f6149fc35d4371
|
|
| MD5 |
27423f373e5d7a0b27a13055353cfd38
|
|
| BLAKE2b-256 |
71edb2e71f2cfdb73869f7b2fdf519d3a0820915943042938140d8f6162c9e07
|
Provenance
The following attestation bundles were made for sabr_replication_demo-0.1.0.tar.gz:
Publisher:
publish.yml on numerical-project-team/numerical-project
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sabr_replication_demo-0.1.0.tar.gz -
Subject digest:
17db648e851b7abd57a931662f2146df9c52a5d56e2e277c37f6149fc35d4371 - Sigstore transparency entry: 1516655462
- Sigstore integration time:
-
Permalink:
numerical-project-team/numerical-project@b37e60ad2cde568a77d578d1a9ed1a0df07b855d -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/numerical-project-team
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b37e60ad2cde568a77d578d1a9ed1a0df07b855d -
Trigger Event:
release
-
Statement type:
File details
Details for the file sabr_replication_demo-0.1.0-py3-none-any.whl.
File metadata
- Download URL: sabr_replication_demo-0.1.0-py3-none-any.whl
- Upload date:
- Size: 21.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6cad5dd798f1ddaff7373a64c96b8e2352d751879f4d096abbf315ad754c8bdc
|
|
| MD5 |
8b1771ca874ab9df4bedbbf221b4697a
|
|
| BLAKE2b-256 |
a9ff3d4f342d5588b51ba5aa68c1860f0eb1a09761814cbd94673ccca97030be
|
Provenance
The following attestation bundles were made for sabr_replication_demo-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on numerical-project-team/numerical-project
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sabr_replication_demo-0.1.0-py3-none-any.whl -
Subject digest:
6cad5dd798f1ddaff7373a64c96b8e2352d751879f4d096abbf315ad754c8bdc - Sigstore transparency entry: 1516655519
- Sigstore integration time:
-
Permalink:
numerical-project-team/numerical-project@b37e60ad2cde568a77d578d1a9ed1a0df07b855d -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/numerical-project-team
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b37e60ad2cde568a77d578d1a9ed1a0df07b855d -
Trigger Event:
release
-
Statement type: