| Title: | Adaptive Multilevel Splitting for Option Simulation and Pricing |
|---|---|
| Description: | Simulation and pricing routines for rare-event options using Adaptive Multilevel Splitting and standard Monte Carlo under Black-Scholes and Heston models. Core routines are implemented in C++ via Rcpp and RcppArmadillo with lightweight R wrappers. |
| Authors: | Riccardo Gozzo [aut, cre] |
| Maintainer: | Riccardo Gozzo <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.0 |
| Built: | 2026-06-01 08:54:39 UTC |
| Source: | https://github.com/riccardogozzo/amssim |
Pipeline per iteration:
Simulate paths under the chosen model (BS/Heston-family).
Compute continuation scores via function_AMS_Cpp.
Set level K-th order statistic of .
Identify survivors (top ) and parents ( indices that cleared the level).
For each parent, cut at first index that exceeds and resimulate the suffix.
Repeat until . Then compute discounted payoff on the final population.
AMS( model, type, funz, n, t, p, r, sigma, S0, rho = NULL, rim = 0L, v0 = 0.04, Lmax = 0, strike = 1, K = 1L )AMS( model, type, funz, n, t, p, r, sigma, S0, rho = NULL, rim = 0L, v0 = 0.04, Lmax = 0, strike = 1, K = 1L )
model |
1 = Black–Scholes; 2,3,4 = Heston variants (as in |
type |
Payoff type passed to |
funz |
1 = BS digital proxy in continuation; 2 = raw feature (signed). |
n |
Population size (> K). |
t |
Maturity in years (>0). |
p |
Total time steps (>0). |
r |
Risk–free rate. |
sigma |
BS volatility (used by continuation; >0 if |
S0 |
Initial spot. |
rho |
Correlation for Heston models (required for |
rim |
Left-trim for simulation (keep last |
v0 |
Initial variance for Heston models (>=0). |
Lmax |
Stopping level: iterate while |
strike |
Strike |
K |
Number of resampled offspring per iteration (1..n-1). |
List with price and std.
out <- AMS(model = 2, type = 3, funz = 1, n = 500, t = 1, p = 252, r = 0.03, sigma = 0.2, rho = -0.5, S0 = 1, rim = 0, Lmax = 0.5, strike = 1.3, K = 200) str(out)out <- AMS(model = 2, type = 3, funz = 1, n = 500, t = 1, p = 252, r = 0.03, sigma = 0.2, rho = -0.5, S0 = 1, rim = 0, Lmax = 0.5, strike = 1.3, K = 200) str(out)
simulate_AMS Monte Carlo simulation of price paths under: 1 = Black–Scholes (exact solution) 2 = Heston (Euler discretisation) 3 = Heston (Milstein discretisation) 4 = Heston (Quadratic–Exponential scheme, Andersen 2008)
simulate_AMS(model, n, t, p, r, sigma, S0, rho = NULL, rim = 0L, v0 = 0.04)simulate_AMS(model, n, t, p, r, sigma, S0, rho = NULL, rim = 0L, v0 = 0.04)
model |
Integer in |
n |
Number of simulated paths (>0). |
t |
Maturity in years (>0). |
p |
Total time steps (>0). |
r |
Risk–free rate. |
sigma |
Black–Scholes volatility (>=0, used only when |
S0 |
Initial spot price (>0). |
rho |
Correlation between asset and variance Brownian motions (required for Heston models, finite in |
rim |
Left–trim: discard the first |
v0 |
Initial variance for Heston models (>=0). |
List: for model 1 returns S (); for Heston models returns S and V.
b <- simulate_AMS(1, n = 50, t = 1, p = 10, r = 0.01, sigma = 0.2, S0 = 100, rho = NULL) str(b)b <- simulate_AMS(1, n = 50, t = 1, p = 10, r = 0.01, sigma = 0.2, S0 = 100, rho = NULL) str(b)