Description Usage Arguments Details Value Author(s) References Examples
compute.implied.volatility
extracts the implied volatility for a call option.
1 | compute.implied.volatility(r, te, s0, k, y, call.price, lower, upper)
|
r |
risk free rate |
te |
time to expiration |
s0 |
current asset value |
k |
strike of the call option |
y |
dividend yield |
call.price |
call price |
lower |
lower bound of the implied volatility to look for |
upper |
upper bound of the implied volatility to look for |
The simple R uniroot
function is used to extract the implied volatility.
sigma |
extratced implied volatility |
Kam Hamidieh
J. Hull (2011) Options, Futures, and Other Derivatives and DerivaGem Package Prentice Hall, Englewood Cliffs, New Jersey, 8th Edition
R. L. McDonald (2013) Derivatives Markets Pearson, Upper Saddle River, New Jersey, 3rd Edition
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | #
# Create prices from BSM with various sigma's
#
r = 0.05
y = 0.02
te = 60/365
s0 = 400
sigma.range = seq(from = 0.1, to = 0.8, by = 0.05)
k.range = floor(seq(from = 300, to = 500, length.out = length(sigma.range)))
bsm.calls = numeric(length(sigma.range))
for (i in 1:length(sigma.range))
{
bsm.calls[i] = price.bsm.option(r = r, te = te, s0 = s0, k = k.range[i],
sigma = sigma.range[i], y = y)$call
}
bsm.calls
k.range
#
# Computed implied sigma's should be very close to sigma.range.
#
compute.implied.volatility(r = r, te = te, s0 = s0, k = k.range, y = y,
call.price = bsm.calls, lower = 0.001, upper = 0.999)
sigma.range
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.