
the theoretical price of a call option contract according to various options
pricing models. Options pricing models like the Black and Scholes, the
Merton’s Jump’s diffusion, the displaced diffusion model, Heston’s
stochastic volatility model, and other can easily be implemented via a
different function.
A simple example of a function named as DiagExtract.m that takes as input a
square matrix and returns in a vector the elements of its main diagonal is
exhibited in Figure 12.
Figure 12: An example of a function
For the function
D
D
i
i
a
a
g
g
E
E
x
x
t
t
r
r
a
a
c
c
t
t note the followings: i) if after executing your
function you get an error, then read the error message that it is returned to
the command window (this is very helpful in finding where to look for the
Commentaires sur ces manuels