Library: | finance |
See also: | HestonCall HestonPut MertonCallMC |
Quantlet: | HestonCallMC | |
Description: | calculates European call option prices in Heston model using Monte Carlo method. |
Usage: | y = HestonCall(S,K,T,r,kappa,theta,sigma,rho,v0,I,M) | |
Input: | ||
S | scalar, asset price | |
K | scalar, exercise price | |
T | scalar, time to maturity | |
r | scalar, interest rate | |
kappa | scalar, rate of mean-reversion | |
theta | scalar, average level of volatility | |
sigma | scalar, volatility of volatility | |
rho | scalar, corelation between two Wiener processes | |
v0 | scalar, initial volatility | |
I | scalar, number of grid points | |
M | scalar, number of trajectories | |
Output: | ||
y | scalar, call option price |
library("finance") randomize2(100) S=100 K=100 T=1 r= 0.2 mu = 0.01 kappa =0.1 rho = 0.0 theta = 0.9 sigma = 0.8 v0 = 0.05 I = 200 M = 1000 y=HestonCallMC(S,K,T,r,kappa,theta,sigma,rho,v0,I,M) y
Contents of y [1,] 22.757