optsensbysabr
Calculate option sensitivities using SABR model
Syntax
Description
specifies options using one or more name-value pair arguments in addition to the input
arguments in the previous syntax. Sens
= optsensbysabr(___,Name,Value
)
Examples
Calculate the Sensitivity Values for an Interest-Rate Swaption
Define the interest rate and the model parameters.
SwapRate = 0.0357; Strike = 0.03; Alpha = 0.036; Beta = 0.5; Rho = -0.25; Nu = 0.35; Rates = 0.05;
Define the Settle
, ExerciseDate
, and OptSpec
for an interest-rate swaption.
Settle = datetime(2013,9,15);
ExerciseDate = datetime(2015,9,15);
OptSpec = 'call';
Define the RateSpec
for the interest-rate curve.
RateSpec = intenvset('ValuationDate', Settle, 'StartDates', Settle, ... 'EndDates', ExerciseDate, 'Rates', Rates, 'Compounding', -1, 'Basis', 1)
RateSpec = struct with fields:
FinObj: 'RateSpec'
Compounding: -1
Disc: 0.9048
Rates: 0.0500
EndTimes: 2
StartTimes: 0
EndDates: 736222
StartDates: 735492
ValuationDate: 735492
Basis: 1
EndMonthRule: 1
Calculate the Delta
and Vega
sensitivity values for the interest-rate swaption.
[SABRDelta, SABRVega] = optsensbysabr(RateSpec, Alpha, Beta, Rho, Nu, Settle, ... ExerciseDate, SwapRate, Strike, OptSpec, 'OutSpec', {'Delta', 'Vega'})
SABRDelta = 0.7025
SABRVega = 0.0772
Calculate the Sensitivity Values for a Swaption Using the Shifted SABR Model
Define the interest rate and the model parameters.
SwapRate = 0.0002; Strike = -0.001; % -0.1% strike. Alpha = 0.01; Beta = 0.5; Rho = -0.1; Nu = 0.15; Shift = 0.005; % 0.5 percent shift Rates = 0.0002;
Define the Settle
, ExerciseDate
, and OptSpec
for the swaption.
Settle = datetime(2016,3,1);
ExerciseDate = datetime(2017,3,1);
OptSpec = 'call';
Define the RateSpec
for the interest-rate curve.
RateSpec = intenvset('ValuationDate',Settle,'StartDates',Settle, ... 'EndDates',ExerciseDate,'Rates',Rates,'Compounding',-1,'Basis', 1)
RateSpec = struct with fields:
FinObj: 'RateSpec'
Compounding: -1
Disc: 0.9998
Rates: 2.0000e-04
EndTimes: 1
StartTimes: 0
EndDates: 736755
StartDates: 736390
ValuationDate: 736390
Basis: 1
EndMonthRule: 1
Calculate the Delta
and Vega
sensitivity values for the swaption.
[ShiftedSABRDelta,ShiftedSABRVega] = optsensbysabr(RateSpec, ... Alpha,Beta,Rho,Nu,Settle,ExerciseDate,SwapRate,Strike,OptSpec, ... 'OutSpec',{'Delta','Vega'},'Shift',Shift)
ShiftedSABRDelta = 0.9628
ShiftedSABRVega = 0.0060
Calculate the Sensitivity Values for an Interest-Rate Swaption with Normal (Bachelier) Implied Volatility
This example shows how to use optsensbysabr
to calculate sensitivities for an interest-rate swaption using the Normal model for the case where the Beta
parameter is > 0
and where Beta
= 0
.
For the case where the Beta
parameter is > 0
, select the Normal (Bachelier) implied volatility model in optsensbysabr
, specify the 'Model'
name-value pair to 'normal'
.
% Define the interest rate and the model parameters. SwapRate = 0.025; Strike = 0.02; Alpha = 0.044; Beta = 0.5; Rho = -0.21; Nu = 0.31; Rates = 0.028; % Define the Settle, ExerciseDate, and OptSpec for the swaption. Settle = datetime(2018,3,7); ExerciseDate = datetime(2020,3,7); OptSpec = 'call'; % Define the RateSpec for the interest-rate curve. RateSpec = intenvset('ValuationDate', Settle, 'StartDates', Settle, ... 'EndDates', ExerciseDate, 'Rates', Rates, 'Compounding', -1, 'Basis', 1); % Calculate the Delta and Vega sensitivity values for the swaption. Set the % 'Model' name-value pair to 'normal' in order to select the Normal % (Bachelier) implied volatility model. [SABRDelta, SABRVega] = optsensbysabr(RateSpec, Alpha, Beta, Rho, Nu, ... Settle, ExerciseDate, SwapRate, Strike, OptSpec, ... 'OutSpec', {'Delta', 'Vega'}, 'Model', 'normal')
SABRDelta = 0.7171
SABRVega = 0.0686
Calculate Sensitivities for a Swaption with Normal Implied Volatility Using the Normal SABR Model
When the Beta
parameter is set to zero, the SABR model becomes the Normal SABR model. Negative interest rates are allowed when the Normal SABR model is used in combination with Normal (Bachelier) implied volatility. To select the Normal (Bachelier) implied volatility model in optsensbysabr
, specify the 'Model' name-value pair to 'normal'.
% Define the interest rate and the model parameters. SwapRate = -0.00254; Strike = -0.002; Alpha = 0.0047; Beta = 0; % Set the Beta parameter to zero to use the Normal SABR model Rho = -0.20; Nu = 0.28; Rates = 0.0001; % Define the Settle, ExerciseDate, and OptSpec for the swaption. Settle = datetime(2018,4,11); ExerciseDate = datetime(2019,4,11); OptSpec = 'call'; % Define the RateSpec for the interest-rate curve. RateSpec = intenvset('ValuationDate', Settle, 'StartDates', Settle, ... 'EndDates', ExerciseDate, 'Rates', Rates, 'Compounding', -1, 'Basis', 1); % Calculate the Delta and Vega sensitivity values for the swaption. Set the % 'Model' name-value pair to 'normal' in order to select the Normal % (Bachelier) implied volatility model. [SABRDelta, SABRVega] = optsensbysabr(RateSpec, Alpha, Beta, Rho, Nu, ... Settle, ExerciseDate, SwapRate, Strike, OptSpec, ... 'OutSpec', {'Delta', 'Vega'}, 'Model', 'normal')
SABRDelta = 0.4644
SABRVega = 0.3987
Input Arguments
ZeroCurve
— Annualized interest-rate term structure for zero-coupon bonds
structure
Annualized interest-rate term structure for zero-coupon bonds, specified by using
the RateSpec
obtained from intenvset
or an IRDataCurve
with multiple rates using
the IRDataCurve
constructor.
Data Types: struct
Alpha
— Current SABR volatility
scalar numeric
Current SABR volatility, specified as a scalar numeric.
Data Types: double
Beta
— SABR constant elasticity of variance (CEV) exponent
scalar numeric
SABR CEV exponent, specified as a scalar numeric.
Data Types: double
Rho
— Correlation between forward value and volatility
scalar numeric
Correlation between forward value and volatility, specified as a scalar numeric.
Data Types: double
Nu
— Volatility of volatility
scalar numeric
Volatility of volatility, specified as a scalar numeric.
Data Types: double
Settle
— Settlement date
datetime scalar | string scalar | date character vector
Settlement date, specified as a scalar datetime, string, or date character vector.
To support existing code, optsensbysabr
also
accepts serial date numbers as inputs, but they are not recommended.
ExerciseDate
— Option exercise date
datetime scalar | string scalar | date character vector
Option exercise date, specified as a scalar datetime, string, or date character vector.
To support existing code, optsensbysabr
also
accepts serial date numbers as inputs, but they are not recommended.
ForwardValue
— Current forward value of underlying asset
scalar numeric | vector
Current forward value of the underlying asset, specified as a scalar numeric or
vector of size NINST
-by-1
.
Data Types: double
Strike
— Option strike price values
scalar numeric | vector
Option strike price values, specified as a scalar numeric or a vector of size
NINST
-by-1
.
Data Types: double
OptSpec
— Definition of option
character vector with value of 'call'
or
'put'
Definition of the option, specified as 'call'
or
'put'
using a character vector.
Data Types: char
Name-Value Arguments
Specify 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: ModifiedSABRDelta =
optsensbysabr(RateSpec,Alpha,Beta,Rho,Nu,Settle,ExerciseDate,ForwardValue,Strike,OptSpec,'OutSpec','ModifiedDelta')
OutSpec
— Sensitivity outputs
'Delta'
(default) | character vector with values 'Delta'
,
'Vega'
, 'ModifiedDelta'
,
'ModifiedVega'
, 'dSigmadF'
,
'dSigmadAlpha'
| cell array of character vectors with values 'Delta'
,
'Vega'
, 'ModifiedDelta'
,
'ModifiedVega'
, 'dSigmadF'
,
'dSigmadAlpha'
Sensitivity outputs, specified as the comma-separated pair consisting of
'OutSpec'
and an NOUT
- by-1
or 1
-by-NOUT
cell array of character vectors
with possible values of 'Delta'
, 'Vega'
,
'ModifiedDelta'
, 'ModifiedVega'
,
'dSigmadF'
, and 'dSigmadAlpha'
where:
'Delta'
is SABR Delta by Hagan et al. (2002).'Vega'
is SABR Vega by Hagan et al. (2002).'ModifiedDelta'
is SABR Delta modified by Bartlett (2006).'ModifiedVega'
is SABR Vega modified by Bartlett (2006).'dSigmadF'
is the sensitivity of implied volatility with respect to the underlying current forward value, F. The implied volatility type depends onShift
andModel
.'dSigmadAlpha'
is the sensitivity of implied volatility with respect to theAlpha
parameter. The implied volatility type depends onShift
andModel
.
Example: OutSpec =
{'Delta','Vega','ModifiedDelta','ModifiedVega','dSigmadF','dSigmadAlpha'}
Data Types: char
| cell
Shift
— Shift in decimals for shifted SABR model
0
(no shift) (default) | scalar positive decimal
Shift in decimals for the shifted SABR model (to be used with the Shifted Black
model), specified as the comma-separated pair consisting of 'Shift'
and a scalar positive decimal value. Set this parameter to a positive shift in
decimals to add a positive shift to ForwardValue
and
Strike
, which effectively sets a negative lower bound for
ForwardValue
and Strike
. For example, a
Shift
value of 0.01
is equal to a 1% positive shift.
Note
If the Model
is set to 'normal'
, the
Shift
parameter must be 0
.
Data Types: double
Model
— Model used by the implied volatility sigma
'lognormal'
(default) | character vector with value 'lognormal'
or
'normal'
| string with value "lognormal"
or
"normal"
Model used by the implied volatility sigma, specified as the comma-separated pair
consisting of 'Model'
and a character vector with a value of
'lognormal'
or 'normal'
, or a string with a
value of "lognormal"
or "normal"
.
Note
The setting for Model
affects the interpretation of the
implied volatility “sigma”. Depending on the setting for Model
,
the “sigma” has the following interpretations:
If
Model
is'lognormal'
(default), “sigma” can be either Implied Black (no shift) or Implied Shifted Black volatility.If
Model
is'normal'
, “sigma” is the Implied Normal (Bachelier) volatility andShift
must be zero.
Data Types: char
| string
Output Arguments
Sens
— Sensitivity values
array
Sensitivity values, returned as an NINST
-by-1
array as defined by the OutSpec
.
Algorithms
In the SABR model, an option with value V is defined by the modified Black formula B, where is the SABR implied Black volatility.
The Delta
and Vega
sensitivities under the SABR
model are expressed in terms of partial derivatives in the original paper by Hagan (2002).
Later, Bartlett (2006) made better use of the model dynamics by incorporating the correlated changes between F and α
where is the classic Black Delta
and is the classic Black Vega
. The Black implied volatility is computed internally by calling blackvolbysabr
, while its partial derivatives and are computed using closed-form expressions by
optsensbysabr
.
Similar expressions apply to the implied Normal volatility
σN. For more information, see normalvolbysabr
.
References
[1] Hagan, P. S., D. Kumar. A. S. Lesniewski, and D. E. Woodward. “Managing Smile Risk.” Wilmott Magazine, 2002.
[2] Bartlett, B. “Hedging under SABR Model.” Wilmott Magazine, 2006.
Version History
Introduced in R2014bR2022b: Serial date numbers not recommended
Although optsensbysabr
supports serial date numbers,
datetime
values are recommended instead. The
datetime
data type provides flexible date and time
formats, storage out to nanosecond precision, and properties to account for time
zones and daylight saving time.
To convert serial date numbers or text to datetime
values, use the datetime
function. For example:
t = datetime(738427.656845093,"ConvertFrom","datenum"); y = year(t)
y = 2021
There are no plans to remove support for serial date number inputs.
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 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)