FFT
Create FFT
pricer object for Vanilla
instrument using Merton
, Heston
, or
Bates
model
Since R2020a
Description
Create and price a Vanilla
instrument object with a
Heston
, Bates
, or Merton
model and an FFT
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 an FFTPricerObj
= finpricer(PricerType
,'Model
',model,'DiscountCurve
',ratecurve_obj)FFT
pricer object by specifying
PricerType
and sets the properties for the required
name-value pair arguments Model
and
DiscountCurve
.
sets optional properties using additional
name-value pairs in addition to the required arguments in the previous
syntax. For example, FFTPricerObj
= finpricer(___,Name,Value
)FFTPricerObj =
finpricer("FFT",'Model',FFTModel,
'DiscountCurve',ratecurve_obj,'SpotPrice',1000,'DividendValue',0.01,'VolRiskPremium',0.9)
creates an FFT
pricer object. You can specify multiple
name-value pair arguments.
Input Arguments
PricerType
— Pricer type
string with value "FFT"
| character vector with value 'FFT'
Pricer type, specified as a string with the value of
"FFT"
or a character vector with the value of
'FFT'
.
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: FFTPricerObj = finpricer("FFT",'Model',FFTModel,
'DiscountCurve',ratecurve_obj,'SpotPrice',1000,'DividendValue',0.01,'VolRiskPremium',0.9)
FFT
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 the 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
FFT
Name-Value Pair ArgumentsDividendValue
— Dividend yield
0 (default) | scalar nonnegative numeric
Dividend yield, specified as the comma-separated pair consisting
of 'DividendValue'
and a scalar nonnegative
numeric in decimals.
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 value 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 in Heston Stochastic Volatility Model and Bates Stochastic Volatility Jump Diffusion Model.false
— Use the original Heston formation.
Data Types: logical
NumFFT
— Number of grid points in characteristic function variable
4096
(default) | numeric
Number of grid points in the characteristic function variable and
in each column of the log-strike grid, specified as the
comma-separated pair consisting of 'NumFFT'
and a
scalar numeric value.
Data Types: double
CharacteristicFcnStep
— Characteristic function variable grid spacing
0.01
(default) | numeric
Characteristic function variable grid spacing, specified as the
comma-separated pair consisting of
'CharacteristicFcnStep'
and a scalar numeric
value.
Data Types: double
LogStrikeStep
— Log-strike grid spacing
2*pi/NumFFT/CharacteristicFcnStep
(default) | numeric
Log-strike grid spacing, specified as the comma-separated pair
consisting of 'LogStrikeStep'
and a scalar
numeric value.
Note
If
(LogStrikeStep
*CharacteristicFcnStep
)
is 2*pi
/NumFFT
, FFT
is used. Otherwise, FRFT is used.
Data Types: double
DampingFactor
— Damping factor for Carr-Madan formulation
1.5
(default) | numeric
Damping factor for the Carr-Madan formulation, specified as the
comma-separated pair consisting of
'DampingFactor'
and a scalar numeric
value.
Data Types: double
Quadrature
— Type of quadrature
"simpson"
(default) | string with value "simpson"
or "trapezoidal"
| character vector with value 'simpson'
or
'trapezoidal'
Type of quadrature, specified as the comma-separated pair
consisting of 'Quadrature'
and a scalar string or
character vector.
Data Types: char
| string
Properties
Model
— Model
model object
Model, returned as a model 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 nonnegative numeric
Dividend yield, returned as a scalar nonnegative numeric in decimals.
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
NumFFT
— Number of grid points in the characteristic function variable
4096
(default) | numeric
Number of grid points in the characteristic function variable and in each column of the log-strike grid, returned as a scalar numeric value.
Data Types: double
CharacteristicFcnStep
— Characteristic function variable grid spacing
0.01
(default) | numeric
Characteristic function variable grid spacing, returned as a scalar numeric value.
Data Types: double
LogStrikeStep
— Log-strike grid spacing
2*pi/NumFFT/CharacteristicFcnStep
(default) | numeric
Log-strike grid spacing, returned as a scalar numeric value.
Data Types: double
DampingFactor
— Damping factor for Carr-Madan formulation
1.5
(default) | numeric
Damping factor for the Carr-Madan formulation, returned as a scalar numeric value.
Data Types: double
Quadrature
— Type of quadrature
"simpson"
(default) | string with value "simpson"
or "trapezoidal"
Type of quadrature, returned as a string.
Data Types: string
Object Functions
price | Compute price for equity instrument with FFT pricer |
Examples
Use FFT
Pricer and Heston
Model to Price Vanilla
Instrument
This example shows the workflow to price a Vanilla
instrument when you use a Heston
model and an FFT
pricing method.
Create Vanilla
Instrument Object
Use fininstrument
to create a Vanilla
instrument object.
VanillaOpt = fininstrument("Vanilla",'ExerciseDate',datetime(2022,9,15),'Strike',105,'ExerciseStyle',"european",'Name',"vanilla_option")
VanillaOpt = Vanilla with properties: OptionType: "call" ExerciseStyle: "european" ExerciseDate: 15-Sep-2022 Strike: 105 Name: "vanilla_option"
Create Heston
Model Object
Use finmodel
to create a Heston
model object.
HestonModel = finmodel("Heston",'V0',0.032,'ThetaV',0.1,'Kappa',0.003,'SigmaV',0.2,'RhoSV',0.9)
HestonModel = Heston with properties: V0: 0.0320 ThetaV: 0.1000 Kappa: 0.0030 SigmaV: 0.2000 RhoSV: 0.9000
Create ratecurve
Object
Create a flat ratecurve
object using ratecurve
.
Settle = datetime(2018,9,15); Maturity = datetime(2023,9,15); Rate = 0.035; myRC = ratecurve('zero',Settle,Maturity,Rate,'Basis',12)
myRC = ratecurve with properties: Type: "zero" Compounding: -1 Basis: 12 Dates: 15-Sep-2023 Rates: 0.0350 Settle: 15-Sep-2018 InterpMethod: "linear" ShortExtrapMethod: "next" LongExtrapMethod: "previous"
Create FFT
Pricer Object
Use finpricer
to create an FFT
pricer object and use the ratecurve
object for the 'DiscountCurve'
name-value pair argument.
outPricer = finpricer("fft",'DiscountCurve',myRC,'Model',HestonModel,'SpotPrice',100,'CharacteristicFcnStep', 0.2,'NumFFT',2^13)
outPricer = FFT with properties: Model: [1x1 finmodel.Heston] DiscountCurve: [1x1 ratecurve] SpotPrice: 100 DividendType: "continuous" DividendValue: 0 NumFFT: 8192 CharacteristicFcnStep: 0.2000 LogStrikeStep: 0.0038 CharacteristicFcn: @characteristicFcnHeston DampingFactor: 1.5000 Quadrature: "simpson" VolRiskPremium: 0 LittleTrap: 1
Price Vanilla
Instrument
Use price
to compute the price and sensitivities for the Vanilla
instrument.
[Price, outPR] = price(outPricer,VanillaOpt,["all"])
Price = 14.7545
outPR = priceresult with properties: Results: [1x7 table] PricerData: []
outPR.Results
ans=1×7 table
Price Delta Gamma Theta Rho Vega VegaLT
______ _______ ________ ________ ______ ______ ______
14.754 0.44868 0.021649 -0.20891 120.45 88.192 1.3248
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 (the square root of the variance) is no longer assumed to be constant, and the variance now follows a stochastic (CIR) process. This process 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 in 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:
Here:
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 in 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:
Here:
μ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 the Poisson process Ptfor (ƛp ≥ 0).
σ is the volatility of the asset price for (σ > 0).
The characteristic function for j = 1 (asset price 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).
Carr-Madan Formulation
The Carr-Madan (1999) formulation is a popular modified implementation of Heston (1993) framework.
Rather than computing the probabilities P1 and P2 as intermediate steps, Carr and Madan developed an alternative expression so that taking its inverse Fourier transform gives the option price itself directly.
Here:
r is the continuous risk-free rate.
q is the continuous dividend yield.
St is the asset price at time t.
τ 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.
α is the damping factor.
u is the characteristic function variable for integration, where ϕ = (u - (α+1)i).
f2(ϕ) is the characteristic function for P2.
P2 is the probability of St > K under the risk-neutral measure for the model.
To apply FFT or FRFT to this formulation, the characteristic function variable for
integration u is discretized into
NumFFT
(N) points with the step size
CharacteristicFcnStep
(Δu), and the
log-strike k is discretized into N points with
the step size LogStrikeStep
(Δk).
The discretized characteristic function variable for integration uj(for j = 1,2,3,…,N) has a minimum value of 0 and a maximum value of (N-1) (Δu), and it approximates the continuous integration range from 0 to infinity.
The discretized log-strike grid
kn(for
n = 1, 2, 3, N) is approximately centered
around
ln
(St),
with a minimum value of
and a maximum value of
Where the minimum allowable strike is
and the maximum allowable strike is
As a result of the discretization, the expression for the call option becomes
Here:
Δu is the step size of the discretized characteristic function variable for integration.
Δk is the step size of the discretized log strike.
N is the number of FFT or FRFT points.
wj is the weights for quadrature used for approximating the integral.
FFT is used to evaluate the above expression if Δk and Δu are subject to the following constraint:
Otherwise, the functions use the FRFT method described in Chourdakis (2005).
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
MATLAB Command
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.
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)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)