Option price and sensitivities by Merton76 model using finite differences
[
computes a vanilla European or American option price and sensitivities by the Merton76
model, using the Crank-Nicolson Adams-Bashforth (CNAB) IMEX method.PriceSens
,PriceGrid
,AssetPrices
,Times
] = optSensByMertonFD(Rate
,AssetPrice
,Settle
,ExerciseDates
,OptSpec
,Strike
,Sigma
,MeanJ
,JumpVol
,JumpFreq
)
[
specifies options using one or more name-value pair arguments in addition to the input
arguments in the previous syntax. PriceSens
,PriceGrid
,AssetPrices
,Times
] = optSensByMertonFD(___,Name,Value
)
Define the option variables and Merton model parameters.
AssetPrice = 90; Strike = 100; Rate = 0.06; DividendYield = 0.1; Settle = '01-Jan-2018'; ExerciseDates = '02-Apr-2018'; Sigma = 0.40; MeanJ = -0.10; JumpVol = 0.01; JumpFreq = 1.00;
Compute the American call option price and sensitivities using the finite differences method.
OptSpec = 'Call'; [Price, Delta, Gamma, Rho, Theta, Vega] = optSensByMertonFD(Rate, AssetPrice, Settle, ExerciseDates, OptSpec, Strike,... Sigma, MeanJ, JumpVol, JumpFreq, 'DividendYield', DividendYield, 'AmericanOpt', 1,... 'OutSpec', ["Price" "Delta" "Gamma" "Rho" "Theta" "Vega"])
Price = 3.4551
Delta = 0.3211
Gamma = 0.0195
Rho = 5.6610
Theta = -11.9877
Vega = 15.5156
Rate
— Continuously compounded risk-free interest rateContinuously compounded risk-free interest rate, specified as a scalar decimal value.
Data Types: double
AssetPrice
— Current underlying asset priceCurrent underlying asset price, specified as a scalar numeric.
Data Types: double
Settle
— Option settlement date Option settlement date, specified as a scalar using a serial date number, date character vector, datetime array, or string array.
Data Types: double
| char
| datetime
| string
ExerciseDates
— Option exercise datesOption exercise dates, specified as a serial date number, date character vector, datetime array, or string array:
For a European option, use a scalar serial date number, date character vector,
datetime array, or string array. For a European option,
ExerciseDates
contains only one value: the option expiry
date.
For an American option, use a 1
-by-2
vector of serial date numbers, date character vectors, datetime arrays, or string
arrays to specify the exercise date boundaries. An American option can be
exercised on any date between or including the pair of dates. If only one
non-NaN
date is listed, then the option can be exercised
between Settle
date and the single listed value in
ExerciseDates
.
Data Types: double
| char
| datetime
| string
OptSpec
— Definition of option 'call'
or
'put'
| string array with value of "call"
or
"put"
Definition of the option, specified as a scalar using a character vector or string
array with a value of 'call'
or 'put'
.
Data Types: cell
| string
Strike
— Option strike price valueOption strike price value, specified as a scalar numeric.
Data Types: double
Sigma
— Volatility of underlying assetVolatility of the underling asset, specified as a scalar numeric.
Data Types: double
MeanJ
— Mean of the random percentage jump sizeMean of the random percentage jump size (J), specified as a
scalar decimal value where log
(1+J) is normally
distributed with the mean
(log
(1+MeanJ
)-0.5*JumpVol
^2)
and the standard deviation JumpVol
.
Data Types: double
JumpVol
— Standard deviation of log
(1+J)Standard deviation of log
(1+J) where
J
is the random percentage jump size, specified as a scalar
decimal.
Data Types: double
JumpFreq
— Annual frequency of Poisson jump processAnnual frequency of the Poisson jump process, specified as a scalar numeric.
Data Types: double
Specify optional
comma-separated pairs of Name,Value
arguments. Name
is
the argument name and Value
is the corresponding value.
Name
must appear inside quotes. You can specify several name and value
pair arguments in any order as
Name1,Value1,...,NameN,ValueN
.
[Price,PriceGrid] =
optByMertonFD(Rate,AssetPrice,Settle,ExerciseDates,OptSpec,Strike,MeanJ,JumpVol,JumpFreq,'Basis',7,'OutSpec','delta')
'Basis'
— Day-count basis of instrument0
(default) | numeric values: 0
,1
, 2
,
3
, 4
, 6
,
7
, 8
, 9
,
10
, 11
, 12
,
13
Day-count basis of the instrument, specified as the comma-separated pair
consisting of 'Basis'
and a scalar using a supported value:
0 = actual/actual
1 = 30/360 (SIA)
2 = actual/360
3 = actual/365
4 = 30/360 (PSA)
5 = 30/360 (ISDA)
6 = 30/360 (European)
7 = actual/365 (Japanese)
8 = actual/actual (ICMA)
9 = actual/360 (ICMA)
10 = actual/365 (ICMA)
11 = 30/360E (ICMA)
12 = actual/365 (ISDA)
13 = BUS/252
For more information, see Basis.
Data Types: double
'DividendYield'
— Continuously compounded underlying asset yield0
(default) | scalar numericContinuously compounded underlying asset yield, specified as the comma-separated
pair consisting of 'DividendYield'
and a scalar numeric.
If you enter a value for DividendYield
, then set
DividendAmounts
and ExDividendDates
=
[ ]
or do not enter them. If you enter values for
DividendAmounts
and ExDividendDates
,
then set DividendYield
= 0
.
Data Types: double
'DividendAmounts'
— Cash dividend amounts[ ]
(default) | vectorCash dividend amounts, specified as the comma-separated pair consisting of
'DividendAmounts'
and an
NDIV
-by-1
vector.
Each dividend amount must have a corresponding ex-dividend date. If you enter
values for DividendAmounts
and
ExDividendDates
, then set
DividendYield
= 0
.
Data Types: double
'ExDividendDates'
— Ex-dividend dates[ ]
(default) | serial date number | date character vector | string array | datetime arrayEx-dividend dates, specified as the comma-separated pair consisting of
'ExDividendDates'
and an
NDIV
-by-1
vector of serial date numbers, date
character vectors, string arrays, or datetime arrays.
Data Types: double
| char
| string
| datetime
'AssetPriceMax'
— Maximum price for price grid boundaryMaximum price for the price grid boundary, specified as the comma-separated pair
consisting of 'AssetPriceMax'
and a positive scalar numeric.
Data Types: double
'AssetGridSize'
— Size of asset grid for the finite difference grid400
(default) | scalar numericSize of the asset grid for finite difference grid, specified as the
comma-separated pair consisting of 'AssetGridSize'
and a scalar
numeric.
Data Types: double
'TimeGridSize'
— Number of nodes of time grid for the finite difference grid100
(default) | positive numeric scalarNumber of nodes of the time grid for finite difference grid, specified as the
comma-separated pair consisting of 'TimeGridSize'
and a positive
numeric scalar.
Data Types: double
'AmericanOpt'
— Option type0
(European) (default) | scalar with value of [0,1]
Option type, specified as the comma-separated pair consisting of
'AmericanOpt'
and a scalar flag with one of these values:
0
— European
1
— American
Data Types: double
'OutSpec'
— Define outputs['price']
(default) | cell array of character vectors with values 'price'
,
'delta'
, 'gamma'
, 'vega'
,
'rho'
, and 'theta'
| string array with values "price"
, "delta"
,
"gamma"
, "vega"
, "rho"
, and
"theta"
Define outputs, specified as the comma-separated pair consisting of
'OutSpec'
and a NOUT
- by-1
or a 1
-by-NOUT
string array or cell array of
character vectors with supported values.
Example: OutSpec =
['price','delta','gamma','vega','rho','theta']
Data Types: string
| cell
PriceSens
— Option price or sensitivitiesOption price or sensitivities, returned as a numeric. The name-value pair argument
OutSpec
determines the types and order of the outputs.
PriceGrid
— Grid containing prices calculated by the finite difference methodGrid containing prices calculated by the finite difference method, returned as a
two-dimensional grid with size AssetGridSize
⨉
TimeGridSize
. The number of columns is not necessarily equal to
the TimeGridSize
because exercise and ex-dividend dates are added
to the time grid. PriceGrid(:, :, end)
contains the price for
t = 0
.
AssetPrices
— Prices of the assetPrices of the asset corresponding to the first dimension of
PriceGrid
, returned as a vector.
Times
— TimesTimes corresponding to the second dimension of PriceGrid
,
returned as a vector.
A vanilla option is a category of options that includes only the most standard components.
A vanilla option has an expiration date and straightforward strike price. American-style options and European-style options are both categorized as vanilla options.
The payoff for a vanilla option is as follows:
For a call:
For a put:
where:
St is the price of the underlying asset at time t.
K is the strike price.
For more information, see Vanilla Option.
The Merton jump diffusion model [2] extends the Black-Scholes model by using the Poisson process to include jump diffusion parameters in the modeling of sudden asset price movements (both up and down).
The stochastic differential equation is
where:
r is the continuous risk-free rate.
q is the continuous dividend yield.
Wt is the Weiner process.
J is the random percentage jump size conditional on the jump
occurring, where ln
(1+J) is normally distributed with
mean and the standard deviation δ, and (1+J) has a lognormal distribution:
where:
μJ is the mean of J for (μJ > -1).
δ is the standard deviation of
ln
(1+J) for (δ≥ 0).
ƛp is the annual frequency (intensity) of Poisson process Ptfor (ƛp ≥ 0).
σ is the volatility of the asset price for (σ > 0).
[1] Cont, R., and E. Voltchkova. “A Finite Difference Scheme for Option Pricing in Jump Diffusion and Exponential Lévy Models.” SIAM Journal on Numerical Analysis. Vol. 43, Number 4, 2005, pp. 1596-1626.
[2] Merton, R. "Option Pricing When Underlying Stock Returns Are Discontinuous." The Journal of Financial Economics. Vol 3. 1976, pp. 125-144.
optByBatesFD
| optByHestonFD
| optByLocalVolFD
| optByMertonFD
| optSensByBatesFD
| optSensByHestonFD
| optSensByLocalVolFD
A modified version of this example exists on your system. Do you want to open this version instead?
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
Select web siteYou can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.