NumericalIntegration
Create NumericalIntegration
pricer object for
Vanilla
instrument using Heston
,
Bates
, or Merton
model
Since R2020a
Description
Create and price a Vanilla
instrument object with a
Heston
, Bates
, or Merton
model and a NumericalIntegration
pricing method using this
workflow:
For more information on this workflow, see Get Started with Workflows Using Object-Based Framework for Pricing Financial Instruments.
For more information on the available pricing methods for a Vanilla
instrument, see Choose Instruments, Models, and Pricers.
Creation
Syntax
Description
creates a NumericalIntegrationPricerObj
= finpricer(PricerType
,'Model
',model,'DiscountCurve
',ratecurve_obj,'SpotPrice
',spotprice_value)NumericalIntegration
pricer object by
specifying PricerType
and sets the properties for
the required name-value pair arguments Model
,
DiscountCurve
, and
SpotPrice
.
sets optional properties
using additional name-value pairs in addition to the required arguments in
the previous syntax. For example, NumericalIntegrationPricerObj
= finpricer(___,Name,Value
)NumericalIntegrationPricerObj =
finpricer("NumericalIntegration",'Model',NIModel,'DiscountCurve',ratecurve_obj,'SpotPrice',1000,'DividendValue',100,'VolRiskPremium',0.9)
creates a NumericalIntegration
pricer object. You can
specify multiple name-value pair arguments.
Input Arguments
PricerType
— Pricer type
string with value "NumericalIntegration"
| character vector with value
'NumericalIntegration'
Pricer type, specified as a string with the value of
"NumericalIntegration"
or a character vector with
the value of 'NumericalIntegration'
.
Data Types: char
| string
Specify required
and optional pairs of arguments as
Name1=Value1,...,NameN=ValueN
, where
Name
is the argument name and Value
is
the corresponding value. Name-value arguments must appear after other arguments,
but the order of the pairs does not matter.
Before R2021a, use commas to separate each name and value, and enclose
Name
in quotes.
Example: NumericalIntegrationPricerObj =
finpricer("NumericalIntegration",'Model',NIModel,'DiscountCurve',ratecurve_obj,'SpotPrice',1000,'DividendValue',100,'VolRiskPremium',0.9)
NumericalIntegration
Name-Value Pair
ArgumentsDiscountCurve
— ratecurve
object for discounting cash flows
ratecurve
object
This property is read-only.
ratecurve
object for discounting cash flows,
specified as the comma-separated pair consisting of
'DiscountCurve'
and the name of a ratecurve
object.
Note
Specify a flat ratecurve
object for
DiscountCurve
. If you use a nonflat
ratecurve
object, the software uses
the rate in the ratecurve
object at
Maturity
and assumes that the value
is constant for the life of the equity option.
Data Types: object
SpotPrice
— Current price of underlying asset
nonnegative numeric
Current price of the underlying asset, specified as the
comma-separated pair consisting of 'SpotPrice'
and a scalar nonnegative numeric.
Data Types: double
NumericalIntegration
Name-Value Pair
ArgumentsDividendValue
— Dividend yield
0
(default) | scalar numeric
Dividend yield, specified as the comma-separated pair consisting
of 'DividendValue'
and a scalar numeric.
Data Types: double
VolRiskPremium
— Volatility risk premium
0
(default) | numeric
Volatility risk premium, specified as the comma-separated pair
consisting of 'VolRiskPremium'
and a scalar
numeric value.
Data Types: double
LittleTrap
— Flag indicating Little Heston Trap formulation
true
(default) | logical with values true
or
false
Flag indicating Little Heston Trap formulation by Albrecher et
al., specified as the comma-separated pair consisting of
'LittleTrap'
and a logical:
true
— Use the Albrecher et al. formulation.For more information on the
LittleTrap
, see [1] and also the Little Trap formulation is defined by Cj and Dj, see Heston Stochastic Volatility Model and Bates Stochastic Volatility Jump Diffusion Model.false
— Use the original Heston formation.
Data Types: logical
AbsTol
— Absolute error tolerance for numerical integration
1e-10
(default) | numeric
Absolute error tolerance for numerical integration, specified as
the comma-separated pair consisting of 'AbsTol'
and a scalar numeric value.
Data Types: double
RelTol
— Relative error tolerance for numerical integration
1e-6
(default) | numeric
Relative error tolerance for numerical integration, specified as
the comma-separated pair consisting of 'RelTol'
and a scalar numeric value.
Data Types: double
IntegrationRange
— Numerical integration range used to approximate continuous integral over [0 Inf]
[1e-9 Inf]
(default) | vector
Numerical integration range used to approximate the continuous
integral over [0 Inf]
, specified as the
comma-separated pair consisting of
'IntegrationRange'
and a
1
-by-2
vector representing
[LowerLimit UpperLimit]
.
Data Types: double
Framework
— Framework for computing option prices and sensitivities using numerical integration of models
"heston1993"
(default) | string with values "heston1993"
or
"lewis2001"
| character vector with values 'heston1993'
or
'lewis2001'
Framework for computing option prices and sensitivities using the
numerical integration of models, specified as the comma-separated
pair consisting of 'Framework'
and a scalar
string or character vector with the following values:
"heston1993"
or'heston1993'
— Method used in Heston (1993)"lewis2001"
or'lewis2001'
— Method used in Lewis (2001)
Data Types: char
| string
Properties
Model
— Model
model object
Model, returned as a model object.
Data Types: object
DiscountCurve
— ratecurve
object for discounting cash flows
object
ratecurve
object for discounting cash flows, returned
as a ratecurve
object.
Data Types: object
SpotPrice
— Current price of underlying asset
nonnegative numeric
Current price of the underlying asset, returned as a scalar nonnegative numeric.
Data Types: double
DividendValue
— Dividend yield
0
(default) | scalar numeric
Dividend yield, returned as a scalar numeric.
Data Types: double
VolRiskPremium
— Volatility risk premium
0
(default) | numeric
Volatility risk premium, returned as a scalar numeric value.
Data Types: double
LittleTrap
— Flag indicating Little Heston Trap formulation
true
(default) | logical with value true
or
false
Flag indicating Little Heston Trap formulation by Albrecher et al., returned as a logical.
Data Types: logical
AbsTol
— Absolute error tolerance for numerical integration
1e-10
(default) | numeric
Absolute error tolerance for numerical integration, returned as a scalar numeric value.
Data Types: double
RelTol
— Relative error tolerance for numerical integration
1e-6
(default) | numeric
Relative error tolerance for numerical integration, returned as a scalar numeric value.
Data Types: double
IntegrationRange
— Numerical integration range used to approximate continuous integral over [0 Inf]
[1e-9 Inf]
(default) | vector
Numerical integration range used to approximate the continuous integral
over [0 Inf]
, returned as a
1
-by-2
vector representing
[LowerLimit UpperLimit]
.
Data Types: double
Framework
— Framework for computing option prices and sensitivities using numerical integration of models
"heston1993"
(default) | string with value "heston1993"
or
"lewis2001"
Framework for computing option prices and sensitivities using the numerical integration of models, returned as a scalar string.
Data Types: string
Object Functions
price | Compute price for equity instrument with NumericalIntegration
pricer |
Examples
Use NumericalIntegration
Pricer and Merton
Model to Price Vanilla
Instrument
This example shows the workflow to price a Vanilla
instrument when you use a Merton
model and a NumericalIntegration
pricing method.
Create Vanilla
Instrument Object
Use fininstrument
to create a Vanilla
instrument object.
VanillaOpt = fininstrument("Vanilla",'ExerciseDate',datetime(2020,3,15),'ExerciseStyle',"european",'Strike',105,'Name',"vanilla_option")
VanillaOpt = Vanilla with properties: OptionType: "call" ExerciseStyle: "european" ExerciseDate: 15-Mar-2020 Strike: 105 Name: "vanilla_option"
Create Merton
Model Object
Use finmodel
to create a Merton
model object.
MertonModel = finmodel("Merton",'Volatility',0.45,'MeanJ',0.02,'JumpVol',0.07,'JumpFreq',0.09)
MertonModel = Merton with properties: Volatility: 0.4500 MeanJ: 0.0200 JumpVol: 0.0700 JumpFreq: 0.0900
Create ratecurve
Object
Create a flat ratecurve
object using ratecurve
.
myRC = ratecurve('zero',datetime(2019,9,15),datetime(2020,3,15),0.02)
myRC = ratecurve with properties: Type: "zero" Compounding: -1 Basis: 0 Dates: 15-Mar-2020 Rates: 0.0200 Settle: 15-Sep-2019 InterpMethod: "linear" ShortExtrapMethod: "next" LongExtrapMethod: "previous"
Create NumericalIntegration
Pricer Object
Use finpricer
to create a NumericalIntegration
pricer object and use the ratecurve
object for the 'DiscountCurve'
name-value pair argument.
outPricer = finpricer("numericalintegration",'Model',MertonModel,'DiscountCurve',myRC,'SpotPrice',100,'DividendValue',.01,'VolRiskPremium',0.9,'LittleTrap',false,'AbsTol',0.5,'RelTol',0.4,'Framework',"lewis2001")
outPricer = NumericalIntegration with properties: Model: [1x1 finmodel.Merton] DiscountCurve: [1x1 ratecurve] SpotPrice: 100 DividendType: "continuous" DividendValue: 0.0100 AbsTol: 0.5000 RelTol: 0.4000 IntegrationRange: [1.0000e-09 Inf] CharacteristicFcn: @characteristicFcnMerton76 Framework: "lewis2001" VolRiskPremium: 0.9000 LittleTrap: 0
Price Vanilla
Instrument
Use price
to compute the price and sensitivities for the Vanilla
instrument.
[Price, outPR] = price(outPricer,VanillaOpt,["all"])
Price = 10.7325
outPR = priceresult with properties: Results: [1x6 table] PricerData: []
outPR.Results
ans=1×6 table
Price Delta Gamma Theta Rho Vega
______ ______ ________ _______ ______ ______
10.732 0.5058 0.012492 -12.969 19.815 27.954
More About
Vanilla Option
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:
Here:
St is the price of the underlying asset at time t.
K is the strike price.
For more information, see Vanilla Option.
Heston Stochastic Volatility Model
The Heston model is an extension of the Black-Scholes model, where the volatility (square root of variance) is no longer assumed to be constant, and the variance now follows a stochastic (CIR) process. This allows modeling the implied volatility smiles observed in the market.
The stochastic differential equation is
Here:
r is the continuous risk-free rate.
q is the continuous dividend yield.
St is the asset price at time t.
vt is the asset price variance at time t.
v0 is the initial variance of the asset price at t = 0 for (v0 > 0).
θ is the long-term variance level for (θ > 0).
κ is the mean reversion speed for the variance for (κ > 0).
σv is the volatility of the variance for (σv > 0).
p is the correlation between the Wiener processes Wt and Wvt for (-1 ≤ p ≤ 1).
The characteristic function for j = 1 (asset price measure) and j = 2 (risk-neutral measure) is
Here:
ϕ is the characteristic function variable.
ƛVolRisk is the volatility risk premium.
τ is the time to maturity (τ = T - t).
i is the unit imaginary number (i2 = -1).
The definitions for Cj and Dj for the Little Heston Trap by Albrecher et al. (2007) are
Bates Stochastic Volatility Jump Diffusion Model
The Bates model (Bates 1996) is an extension of the Heston model where, in addition to stochastic volatility, the jump diffusion parameters similar to Merton (1976) are also added to model sudden asset price movements.
The stochastic differential equation is
Here:
r is the continuous risk-free rate.
q is the continuous dividend yield.
St is the asset price at time t.
vt is the asset price variance at time t.
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:
v0 is the initial variance of the asset price at t = 0 (v0> 0).
θ is the long-term variance level for (θ > 0).
κ is the mean reversion speed for (κ > 0).
σv is the volatility of variance for (σv > 0).
p is the correlation between the Wiener processes Wt and for (-1 ≤ p ≤ 1).
μJ is the mean of J for (μJ > -1).
δ is the standard deviation of
ln
(1+J) for (δ ≥ 0).
is the annual frequency (intensity) of Poisson process Pt for ( ≥ 0).
The characteristic function for j = 1 (asset price mean measure) and j = 2 (risk-neutral measure) is
Here:
ϕ is the characteristic function variable.
ƛVolRisk is the volatility risk premium.
τ is the time to maturity for (τ = T - t).
i is the unit imaginary number for (i2= -1).
The definitions for Cj and Dj for the Little Heston Trap by Albrecher et al. (2007) are
Merton Jump Diffusion Model
The Merton jump diffusion model (Merton 1976) is an extension of the Black-Scholes model, where sudden asset price movements (both up and down) are modeled by adding the jump diffusion parameters with the Poisson process.
The stochastic differential equation is
Here:
r is the continuous risk-free rate.
q is the continuous dividend yield.
Wt is the Wiener 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
μ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).
The characteristic function for j = 1 (asset prices measure) and j = 2 (risk-neutral measure) is
Here:
ϕ is the characteristic function variable
τ is the time to maturity (τ = T- t).
i is the unit imaginary number ( i2 = -1).
Numerical Integration Method Under Heston (1993) Framework
Numerical integration is used to evaluate the continuous integral for the inverse Fourier transform.
The numerical integration method under the Heston (1993) framework is based on the following expressions
Here:
r is the continuous risk-free rate.
q is the continuous dividend yield.
St is the asset price at time t.
K is the strike.
τ is time to maturity (τ = T-t).
Call(K) is the call price at strike K.
Put(K) is the put price at strike K.
i is a unit imaginary number (i2= -1).
ϕ is the characteristic function variable.
fj(ϕ) is the characteristic function for Pj(j = 1,2).
P1 is the probability of St > K under the asset price measure for the model.
P2 is the probability of St > K under the risk-neutral measure for the model.
Where j = 1,2 so that f1(ϕ) and f2(ϕ) are the characteristic functions for probabilities P1 and P2, respectively.
Choose this framework by specifying the default value
"Heston1993"
for the Framework
name-value pair argument.
Numerical Integration Method Under Lewis Framework
Numerical integration is used to evaluate the continuous integral for the inverse Fourier transform.
The numerical integration method under the Lewis (2001) framework is based on the following expressions:
Here
r is the continuous risk-free rate.
q is the continuous dividend yield.
St is the asset price at time t.
K is the strike.
τ is time to maturity (τ = T-t).
Call(K) is the call price at strike K.
Put(K) is the put price at strike K.
i is a unit imaginary number (i2= -1).
ϕ is the characteristic function variable.
u is the characteristic function variable for integration, where .
f2(ϕ) is the characteristic function for P2.
P2 is the probability of St > K under the risk-neutral measure for the model.
Choose this framework by specifying the value "Lewis2001"
for
the Framework
name-value pair argument.
References
[1] Albrecher, H., P. Mayer, W. Schoutens, and J. Tistaert. “The Little Heston Trap.” Working Paper, Linz and Graz University of Technology, K.U. Leuven, ING Financial Markets, 2006.
Version History
Introduced in R2020a
Comando MATLAB
Hai fatto clic su un collegamento che corrisponde a questo comando MATLAB:
Esegui il comando inserendolo nella finestra di comando MATLAB. I browser web non supportano i comandi MATLAB.
Select a Web Site
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: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)