Description Usage Arguments Value Examples
The hestonSLVOptionPricer
function evaluates a vanilla option
with European or American exercise
under the Heston Stochastic Volatility model using Finite Difference methods.
The option value and the common first
derivatives ("Greeks") are returned.
1 2 3 | hestonSLVOptionPricer(referenceDate, strike, optionType, exerciseType,
maturityDate, hestonProcess, leverageFunction, tGrid=51, xGrid=401,
vGrid=51, dampingSteps=0, fdmScheme = "ModifiedCraigSneyd")
|
referenceDate |
a date setting the reference date for the calculation |
strike |
the strike price of the option |
optionType |
a string with one of the values “call” or “put” |
exerciseType |
a string with one of the values “european” or “american” |
maturityDate |
the maturity date |
hestonProcess |
the Heston model part of the HestonSLV specification |
leverageFunction |
the leverage function of the HestonSLV model |
tGrid |
number of time steps for the Finite Difference scheme |
xGrid |
number of grid points in spot direction |
vGrid |
number of grid points in variance direction |
dampingSteps |
number of damping steps to avoid spurious oscillations |
fdmScheme |
the Finite Difference scheme, a string with one of the values “Hundsdorfer”, “ModifiedHundsdorfer”, “Douglas”, “CraigSneyd”, “ModifiedCraigSneyd”, “ImplicitEuler” or “ExplicitEuler” |
The hestonSLVOptionPricer
function returns a list with the following
components:
value |
npv of option |
delta |
change in option value for a change in the underlying |
gamma |
change in option delta for a change in the underlying |
theta |
change in option value for a change in t |
impliedVol |
implied Black-Scholes-Merton volatility of the option |
1 2 3 4 5 6 7 8 9 10 11 | process <- HestonProcess(function(t,s) {0.05}, function(t,s) {0.02},
100, 0.09, 1.0, 0.06, 0.4, -0.75)
leverageFct <- function(t, s) { exp(-t)*(s+70)/100.0 }
s <- seq(50, 200, 10)
plot(s, sapply(s, function(strike) {
hestonSLVOptionPricer(Sys.Date(), strike, "call", "european",
Sys.Date()+182, process, leverageFct)$impliedVol
}), type="b",lty=2, ylab="Implied Volatility",xlab="Strike"
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.