powered by
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)
List: for model 1 returns S (\(n \times (p-rim+1)\)); for Heston models returns S and V.
S
V
Integer in \(\{1,2,3,4\}\) selecting the model.
Number of simulated paths (>0).
Maturity in years (>0).
Total time steps (>0).
Risk–free rate.
Black–Scholes volatility (>=0, used only when model == 1).
model == 1
Initial spot price (>0).
Correlation between asset and variance Brownian motions (required for Heston models, finite in \([-1,1]\)).
Left–trim: discard the first rim time steps (0 <= rim < p). Returned matrices keep p - rim + 1 columns including the initial time.
rim
p - rim + 1
Initial variance for Heston models (>=0).
# \donttest{ b <- simulate_AMS(1, n = 50, t = 1, p = 10, r = 0.01, sigma = 0.2, S0 = 100, rho = NULL) str(b) # }
Run the code above in your browser using DataLab