Log-normal moment-matching simulation for GARCH diffusion option pricing
Project description
garch-lnmm
Log-normal and Shifted-lognormal moment-matching simulation for European call option pricing under the GARCH diffusion model
Problem
The continuous-time GARCH diffusion model is useful for stochastic volatility option pricing, but standard Euler discretization can generate negative variance values. In practice, truncation is often applied, which may introduce discretization bias under coarse time steps.
This package implements and compares positivity-preserving moment-matching schemes, including Log-Normal Moment-Matching (LN-MM) and Shifted Log-Normal Moment-Matching (SLN-MM), against Euler conditional Monte Carlo and the Taylor closed-form analytical approximation from Barone-Adesi et al. (2003).
The conditional mean, variance, and skewness used in these schemes are computed from the exact conditional moments of the next-step GARCH diffusion variance transition.
Installation
pip install garch-lnmm
Quick Start
from garch_lnmm import GarchDiffusionMC
model = GarchDiffusionMC(
S0=100,
V0=0.16,
r=0.05,
kappa=0.75,
theta=0.04,
sigma=0.85,
rho=0,
T=5,
)
lnmm_price = model.simulate_moment_matching_cond_mc(
N_paths=50000,
N_steps=32,
K=130,
seed=42,
)
slnmm_price = model.simulate_shifted_lognormal_cond_mc(
N_paths=50000,
N_steps=32,
K=130,
seed=42,
)
print("LN-MM price:", lnmm_price)
print("SLN-MM price:", slnmm_price)
API Reference
GarchDiffusionMC(S0, V0, r, kappa, theta, sigma, rho, T)
Main simulator class for the continuous-time GARCH diffusion model.
| Parameter | Type | Description |
|---|---|---|
S0 |
float | Initial stock price |
V0 |
float | Initial variance |
r |
float | Risk-free interest rate |
kappa |
float | Mean-reversion speed of variance |
theta |
float | Long-run variance level |
sigma |
float | Volatility of variance |
rho |
float | Correlation parameter |
T |
float | Maturity |
simulate_euler_cond_mc(N_paths, N_steps, K, seed=None, return_stats=False)
Prices a European call using truncated Euler conditional Monte Carlo.
| Parameter | Type | Description |
|---|---|---|
N_paths |
int | Number of Monte Carlo paths |
N_steps |
int | Number of time steps |
K |
float | Strike price |
seed |
int or None | Random seed |
return_stats |
bool | If True, return price and error statistics |
Returns:
| Field | Type | Description |
|---|---|---|
price |
float | Estimated option price |
std_dev |
float | Sample standard deviation |
std_error |
float | Monte Carlo standard error |
simulate_moment_matching_cond_mc(N_paths, N_steps, K, seed=None, return_stats=False)
Prices a European call using the Log-Normal Moment-Matching scheme.
| Parameter | Type | Description |
|---|---|---|
N_paths |
int | Number of Monte Carlo paths |
N_steps |
int | Number of time steps |
K |
float | Strike price |
seed |
int or None | Random seed |
return_stats |
bool | If True, return price and error statistics |
Returns:
| Field | Type | Description |
|---|---|---|
price |
float | Estimated option price |
std_dev |
float | Sample standard deviation |
std_error |
float | Monte Carlo standard error |
simulate_shifted_lognormal_cond_mc(N_paths, N_steps, K, seed=None, return_stats=False)
Prices a European call using the Shifted Log-Normal Moment-Matching scheme.
This method computes the first three exact conditional raw moments of the next-step variance transition (V(t+h)), converts them into conditional mean, variance, and skewness, and then samples from a shifted-lognormal approximation matching these moments.
| Parameter | Type | Description |
|---|---|---|
N_paths |
int | Number of Monte Carlo paths |
N_steps |
int | Number of time steps |
K |
float | Strike price |
seed |
int or None | Random seed |
return_stats |
bool | If True, return price and error statistics |
Returns:
| Field | Type | Description |
|---|---|---|
price |
float | Estimated option price |
std_dev |
float | Sample standard deviation |
std_error |
float | Monte Carlo standard error |
License
MIT
Demo Notebook
References
Choi, J., Hu, L., & Kwok, Y. K. (2024).
Efficient and Accurate Simulation of the Stochastic-Alpha-Beta-Rho Model.
Motivates the shifted-lognormal moment-matching framework used in the SLN-MM extension.
Barone-Adesi, G., Rasmussen, H., & Ravanelli, C. (2003).
An Option Pricing Formula for the GARCH Diffusion Model.
Provides the conditional moments and Taylor approximation used as analytical benchmarks in this project.
Andersen, L. (2008).
Simple and Efficient Simulation of the Heston Stochastic Volatility Model.
Motivates the moment-matching methodology adopted for the variance simulation scheme.
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 garch_lnmm-0.1.0.tar.gz.
File metadata
- Download URL: garch_lnmm-0.1.0.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
acd7522ab6555fc1177c5773e664a6056d9d8e00faf599b31f6bde66248bd7bf
|
|
| MD5 |
51d8eeed9293880ef23c00fe4ee0621a
|
|
| BLAKE2b-256 |
1b1315e54f5e047d8b7205e522c7ba3dcd927bcc80a61f4db9f8308d501ef55f
|
Provenance
The following attestation bundles were made for garch_lnmm-0.1.0.tar.gz:
Publisher:
publish.yml on JM357/MATH5030Group11
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
garch_lnmm-0.1.0.tar.gz -
Subject digest:
acd7522ab6555fc1177c5773e664a6056d9d8e00faf599b31f6bde66248bd7bf - Sigstore transparency entry: 1524676268
- Sigstore integration time:
-
Permalink:
JM357/MATH5030Group11@9916c617d385ce61d5b4f3fde017f9702e485b23 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/JM357
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9916c617d385ce61d5b4f3fde017f9702e485b23 -
Trigger Event:
release
-
Statement type:
File details
Details for the file garch_lnmm-0.1.0-py3-none-any.whl.
File metadata
- Download URL: garch_lnmm-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.7 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 |
52099363ba9d2d4fd5d592bfe846bb6a49374bcd23d63868e3c663670916eb9b
|
|
| MD5 |
31017d33c928c4edeb49232537fc9e2c
|
|
| BLAKE2b-256 |
590c899eafb72f0bb51c592f74dab61595b22572a647e1524b726865059a4c6d
|
Provenance
The following attestation bundles were made for garch_lnmm-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on JM357/MATH5030Group11
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
garch_lnmm-0.1.0-py3-none-any.whl -
Subject digest:
52099363ba9d2d4fd5d592bfe846bb6a49374bcd23d63868e3c663670916eb9b - Sigstore transparency entry: 1524676285
- Sigstore integration time:
-
Permalink:
JM357/MATH5030Group11@9916c617d385ce61d5b4f3fde017f9702e485b23 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/JM357
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9916c617d385ce61d5b4f3fde017f9702e485b23 -
Trigger Event:
release
-
Statement type: