Description Arguments Objects from the Class Examples
Translates a Heston model into the corresponding local volatility surface with the same option prices.
referenceDate |
a date setting the reference date for the calculation |
maxDate |
a date setting the end date of the calculation |
hestonProcess |
an object of the class HestonProcess defining the Heston model |
An instance of the class calculates the corresponding local volatility surface for a given the Heston model, which results in the same option prices.
Objects can be created by calls of the form
new("HestonLocalVolSurface", referenceDate, maxDate, hestonProcess)
1 2 3 4 5 6 7 8 9 10 | #Heston process with r=0.05, c=0.02, spot=100, v0=0.09, kappa=1, theta=0.06, sigma=0.4 and rho=-0.75
process <- HestonProcess(function(t,s) {0.05}, function(t,s) {0.02},
100, 0.09, 1.0, 0.06, 0.4, -0.75)
hestonLocalVol <- new(HestonLocalVolSurface, Sys.Date(),Sys.Date()+365, process)
s <- seq(50, 200, 1)
plot(s, sapply(s, function(spot) { hestonLocalVol$localVol(1.0, spot) }), type='l',
ylab="Local Volatility", xlab="Spot", main="Local Volatility in One Year")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.