Library: | finance |
See also: | HestonVanilla ImplVolaFX |
Quantlet: | HestonVanillaSmile | |
Description: | determines the volatility smile implied by the Heston model. |
Usage: | smile = HestonVanillaSmile(phi,spot,strikes,v0,vv,rd,rf,tau,kappa,theta,lambda,rho,GL) | |
Input: | ||
phi | scalar, phi = 1 - call option, phi = -1 - put option | |
spot | scalar, spot price | |
strikes | n x 1 vector, strikes | |
v0 | scalar, initial volatility | |
vv | scalar, vol of vol | |
rd | scalar, domestic interest rate | |
rf | scalar, foreign interest rate | |
tau | scalar, maturity (in years) | |
kappa | scalar, mean reversion | |
theta | scalar, long-run mean | |
lambda | scalar, market price of risk | |
rho | scalar, correlation | |
GL | vector, Gauss-Legendre quadrature (e.g. as obtained using GaussLegendre) | |
Output: | ||
smile | vector (n x 1), volatility smile |
library("finance") delta = #(.1,.2,.3,.4,.5,.6,.7,.8,.9) marketvols = #(0.1135, 0.109, 0.10425, 0.1025, 0.102, 0.103, 0.10575, 0.1105, 0.1165) spot = 1.215 ; spot on July 1, 2004 rd = 0.02165 rf = 0.01845 tau = 0.5 phi = 1 ; call option strikes = GarmanKohlhagen(spot,delta,marketvols,rd,rf,tau,phi,20) GL = GaussLegendre(0,100,100,1e-14) v0 = 0.01 vv = 0.25 kappa = 1.5 theta = 0.015 rho = 0.05 lambda = 0 smile=HestonVanillaSmile(phi,spot,strikes,v0,vv,rd,rf,tau,kappa,theta,lambda,rho,GL) smile
Contents of smile [1,] 0.11361 [2,] 0.10754 [3,] 0.10404 [4,] 0.10209 [5,] 0.10114 [6,] 0.10111 [7,] 0.10214 [8,] 0.10475 [9,] 0.1104