Description Usage Arguments Details Value
View source: R/calibrate_kou.R
Calibrate the parameters of the Kou jump-diffusion model to market prices.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | calibrate_kou(
initial_guess,
market,
spot,
maturity,
rate,
div,
ku,
kd,
what,
style,
N,
M,
generate = FALSE,
bounds = NULL
)
|
initial_guess |
initial guess of parameters, see details |
market |
market data, see details |
spot |
the underlying spot price |
maturity |
the option contract's maturity |
rate |
the risk-neutral rate |
div |
the dividend yield rate |
ku |
the upward jump displacement |
kd |
the downward jump displacement |
what |
what option to price |
style |
style of optionality: american or european |
N |
time resolution |
M |
space resolution |
generate |
whether to immediately generate a set of model prices |
bounds |
lower and upper bounds for parameters |
This is just a simple wrapper to R's base optim
function for minimizing/maximizing functions of several
parameters. We choose to fix the parameters: rate
, div
, ku
, and kd
and fit the model
based on the remaining parameters. Calibrations tend to fail for deep OTM and moderately ITM options and no input
handling is done in this function to prevent this, so it is up to the user to pass good data to this calibration routine.
The objective function to minimize is merely the mean-square error between the market prices and the model prices.
This is available explicitly as meansq_price_error_kou
.
The input initial_guess
should be a vector of 5 dimensions containing (not necessarily named)
volat
the annual volatility level
lambda
the mean rate of jumps per year
prob
the probability of upward jumps
alpha
the mean upward jump size
beta
the mean downward jump size
The input bounds
should be a list containing, which may be set to NULL for default bounds
lower
the lower bounds of the parameters to calibrate
upper
the upper bounds of the parameters to calibrate
The input market
should be a data.frame containing
strike
the strike price
fee
the market price
Either a list from optim
or a list containing
market
a list containing strike
, fee
and model
fit
the object returned from optim
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.