
arguments precede the optional ones (the optional are “dv”, “maxNumIter”
and “tol”).
Use as inputs the initial data from the loaded txt file (without considering s).
The function should make similar checking like previous functions with the
additional that:
• If not specified, “maxNumIter” should be equal to 100.
• If not specified, “tol” should be 1e-5.
• At the beginning of the function, it should be tested whether with a
small value of s (e.g. s=0.001) the c
BSM
and p
BSM
are greater than c
mrk
and p
mrk
respectively; if such condition holds (it can be observed in
practice as an arbitrage result), an implied volatility value that
minimizes |g(e)| does not exist, so the function should return a
“NaN” value.
• To help the algorithm convergence rate and to save computing time,
the starting values for the algorithm should be given from the
following approximation suggested by Bharadia, Christofides and
Salkin [3]:
for call options:
+
−
=
−
dXe
dc
?
p
s
rT
mrk
imp
2
0
, and,
for put options:
+
+
=
−
dXe
dp
?
p
s
rT
mrk
imp
2
0
with,
)XeS(.d
rT−
−= 50
To use the implied volatility function, replace the volatility column of
the options data that were previously loaded from the text file with
random values taken from a uniform distribution on the interval [0,1]
(use the build in function:
r
r
a
a
n
n
d
d). Afterwards, use the
B
B
S
S
M
M
p
p
r
r
i
i
c
c
e
e to find
the theoretical values for calls and puts. In the following, use the
B
B
S
S
M
M
i
i
m
m
p
p
l
l
i
i
e
e
d
d
V
V
o
o
l
l to verify that the implied volatility is quite close with
Commentaires sur ces manuels