Learn R Programming

amsSim (version 0.1.0)

AMS: AMS Adaptive Multilevel Splitting estimator for rare-event option payoffs.

Description

Pipeline per iteration:

  • Simulate \(n\) paths under the chosen model (BS/Heston-family).

  • Compute continuation scores \(a_{i,j}\) via function_AMS_Cpp.

  • Set level \(L =\) K-th order statistic of \(\max_j a_{i,j}\).

  • Identify survivors (top \(n-K\)) and parents (\(K\) indices that cleared the level).

  • For each parent, cut at first index that exceeds \(L\) and resimulate the suffix.

  • Repeat until \(L \ge L_{\max}\). Then compute discounted payoff on the final population.

Usage

AMS(
  model,
  type,
  funz,
  n,
  t,
  p,
  r,
  sigma,
  S0,
  rho = NULL,
  rim = 0L,
  v0 = 0.04,
  Lmax = 0,
  strike = 1,
  K = 1L
)

Value

List with price and std.

Arguments

model

1 = Black–Scholes; 2,3,4 = Heston variants (as in simulate_AMS).

type

Payoff type passed to payoff() and function_AMS_Cpp (1..6).

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 funz == 1).

S0

Initial spot.

rho

Correlation for Heston models (required for model >= 2, in \([-1,1]\)).

rim

Left-trim for simulation (keep last p - rim steps; 0 <= rim < p).

v0

Initial variance for Heston models (>=0).

Lmax

Stopping level: iterate while \(L < L_{\max}\).

strike

Strike \(K\) used by continuation and final payoff.

K

Number of resampled offspring per iteration (1..n-1).

Examples

Run this code
# \donttest{
  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)
# }

Run the code above in your browser using DataLab