swaptionbynormal
Price swaptions using Normal or Bachelier option pricing model
Syntax
Description
prices swaptions using the Normal or Bachelier option pricing model.Price
= swaptionbynormal(RateSpec
,OptSpec
,Strike
,Settle
,ExerciseDates
,Maturity
,Volatility
)
Note
Alternatively, you can use the Swaption
object to price
swaption instruments. For more information, see Get Started with Workflows Using Object-Based Framework for Pricing Financial Instruments.
adds optional name-value pair arguments. Price
= swaptionbynormal(___,Name,Value
)
Examples
Price a Swaption Using the Normal Model
Define the zero curve, and create a RateSpec
.
Settle = datetime(2016,1,20); ZeroTimes = [.5 1 2 3 4 5 7 10 20 30]'; ZeroRates = [0.0052 0.0055 0.0061 0.0073 0.0094 0.0119 0.0168 0.0222 0.0293 0.0307]'; ZeroDates = datemnth(Settle,12*ZeroTimes); RateSpec = intenvset('StartDate',Settle,'EndDates',ZeroDates,'Rates',ZeroRates)
RateSpec = struct with fields:
FinObj: 'RateSpec'
Compounding: 2
Disc: [10x1 double]
Rates: [10x1 double]
EndTimes: [10x1 double]
StartTimes: [10x1 double]
EndDates: [10x1 double]
StartDates: 736349
ValuationDate: 736349
Basis: 0
EndMonthRule: 1
Define the swaption.
ExerciseDate = datetime(2021,1,20);
Maturity = datetime(2026,1,20);
OptSpec = 'call';
LegReset = [1 1];
Compute the par swap rate.
[~,ParSwapRate] = swapbyzero(RateSpec,[NaN 0],Settle,Maturity,'LegReset',LegReset)
ParSwapRate = 0.0216
Strike = ParSwapRate; BlackVol = .3; NormalVol = BlackVol*ParSwapRate;
Price with Black volatility.
Price = swaptionbyblk(RateSpec,OptSpec,Strike,Settle,ExerciseDate,Maturity,BlackVol)
Price = 5.9756
Price with Normal volatility.
Price_Normal = swaptionbynormal(RateSpec,OptSpec,Strike,Settle,ExerciseDate,Maturity,NormalVol)
Price_Normal = 5.5537
Price a Swaption with a Receiving and Paying Leg Using the Normal Model
Create a RateSpec
.
Rate = 0.06; Compounding = -1; ValuationDate = datetime(2010,1,1); EndDates = datetime(2020,1,1); Basis = 1; RateSpec = intenvset('ValuationDate', ValuationDate,'StartDates', ValuationDate, ... 'EndDates', EndDates, 'Rates', Rate, 'Compounding', Compounding, 'Basis', Basis);
Define the swaption.
ExerciseDate = datetime(2021,1,20); Maturity = datetime(2026,1,20); Settle = datetime(2010,1,1); OptSpec = 'call'; Strike = .09; NormalVol = .03; Reset = [1 4]; % 1st column represents receiving leg, 2nd column represents paying leg Basis = [1 7]; % 1st column represents receiving leg, 2nd column represents paying leg
Price with Normal volatility.
Price_Normal = swaptionbynormal(RateSpec,OptSpec,Strike,Settle,ExerciseDate,Maturity,NormalVol,'Reset',Reset,'Basis',Basis)
Price_Normal = 5.9084
Price a Swaption Using swaptionbynormal
and Compare to swaptionbyblk
Define the RateSpec
.
Settle = datetime(2016,1,20); ZeroTimes = [.5 1 2 3 4 5 7 10 20 30]'; ZeroRates = [0.0052 0.0055 0.0061 0.0073 0.0094 0.0119 0.0168 0.0222 0.0293 0.0307]'; ZeroDates = datemnth(Settle,12*ZeroTimes); RateSpec = intenvset('StartDate',Settle,'EndDates',ZeroDates,'Rates',ZeroRates)
RateSpec = struct with fields:
FinObj: 'RateSpec'
Compounding: 2
Disc: [10x1 double]
Rates: [10x1 double]
EndTimes: [10x1 double]
StartTimes: [10x1 double]
EndDates: [10x1 double]
StartDates: 736349
ValuationDate: 736349
Basis: 0
EndMonthRule: 1
Define the swaption instrument and price with swaptionbyblk
.
ExerciseDate = datetime(2021,1,20); Maturity = datetime(2026,1,20); OptSpec = 'call'; [~,ParSwapRate] = swapbyzero(RateSpec,[NaN 0],Settle,Maturity,'StartDate',ExerciseDate)
ParSwapRate = 0.0326
Strike = ParSwapRate; BlackVol = .3; NormalVol = BlackVol*ParSwapRate; Price = swaptionbyblk(RateSpec,OptSpec,Strike,Settle,ExerciseDate,Maturity,BlackVol)
Price = 3.6908
Price the swaption instrument using swaptionbynormal
.
Price_Normal = swaptionbynormal(RateSpec,OptSpec,Strike,Settle,ExerciseDate,Maturity,NormalVol)
Price_Normal = 3.7602
Price the swaption instrument using swaptionbynormal
for a negative strike.
Price_Normal = swaptionbynormal(RateSpec,OptSpec,-.005,Settle,ExerciseDate,Maturity,NormalVol)
Price_Normal = 16.3674
Input Arguments
RateSpec
— Interest-rate term structure
structure
Interest-rate term structure (annualized and continuously compounded),
specified by the RateSpec
obtained from intenvset
. For information on the interest-rate
specification, see intenvset
.
If the discount curve for the paying leg is different than the
receiving leg, RateSpec
can be a NINST
-by-2
input
variable of RateSpec
s, with the second input being
the discount curve for the paying leg. If only one curve is specified,
then it is used to discount both legs.
Data Types: struct
OptSpec
— Definition of option
character vector with values 'call'
or 'put'
| cell array of character vector with values 'call'
or 'put'
Definition of the option as 'call'
or 'put'
,
specified as a NINST
-by-1
cell
array of character vectors.
A 'call'
swaption, or Payer
swaption, allows the option buyer to enter into an interest-rate
swap in which the buyer of the option pays the fixed rate and receives
the floating rate.
A 'put'
swaption, or Receiver
swaption, allows the option buyer to enter into an interest-rate
swap in which the buyer of the option receives the fixed rate and
pays the floating rate.
Data Types: char
| cell
Strike
— Strike swap rate values
decimal
Strike swap rate values, specified as a NINST
-by-1
vector
of decimal values.
Data Types: double
Settle
— Settlement date
datetime array | string array | date character vector
Settlement date (representing the settle date for each swaption), specified as a
NINST
-by-1
vector using a datetime array, string
array, or date character vectors. Settle
must not be later than
ExerciseDates
.
To support existing code, swaptionbynormal
also
accepts serial date numbers as inputs, but they are not recommended.
The Settle
date input for swaptionbynormal
is
the valuation date on which the swaption (an option to enter into
a swap) is priced. The swaption buyer pays this price on this date
to hold the swaption.
ExerciseDates
— Dates on which swaption expires and underlying swap starts
datetime array | string array | date character vector
Dates on which the swaption expires and the underlying swap starts, specified as a
NINST
-by-1
vector using a datetime array, string
array, or date character vectors. There is only one ExerciseDate
on
the option expiry date. This is also the StartDate
of the underlying
forward swap.
To support existing code, swaptionbynormal
also
accepts serial date numbers as inputs, but they are not recommended.
Maturity
— Maturity date for each forward swap
datetime array | string array | date character vector
Maturity date for each forward swap, specified as a
NINST
-by-1
vector using a datetime array, string
array, or date character vectors.
To support existing code, swaptionbynormal
also
accepts serial date numbers as inputs, but they are not recommended.
Volatility
— Volatilities values
numeric
Volatilities values (for normal volatility), specified as a NINST
-by-1
vector
of numeric values.
For more information on the Normal model, see Work with Negative Interest Rates Using Functions.
Data Types: double
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: Price = swaptionbynormal(OISCurve,OptSpec,Strike,Settle,ExerciseDate,Maturity,NormalVol,'Reset',4)
Reset
— Reset frequency per year for underlying forward swap
1
(default) | numeric
Reset frequency per year for the underlying forward swap, specified as the comma-separated
pair consisting of 'Reset'
and a
NINST
-by-1
vector or
NINST
-by-2
matrix representing the reset
frequency per year for each leg. If Reset
is
NINST
-by-2
, the first column represents the
receiving leg, while the second column represents the paying leg.
Data Types: double
Basis
— Day-count basis of instrument
0
(actual/actual) (default) | integer from 0
to 13
Day-count basis of the instrument representing the basis used when annualizing the input term
structure, specified as the comma-separated pair consisting of
'Basis'
and a NINST
-by-1
vector or NINST
-by-2
matrix representing the
basis for each leg. If Basis
is
NINST
-by-2
, the first column represents the
receiving leg, while the second column represents the paying leg.
Values are:
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
Principal
— Notional principal amount
100
(default) | numeric
Notional principal amount, specified as the comma-separated
pair consisting of 'Principal'
and a NINST
-by-1
vector.
Data Types: double
ProjectionCurve
— Rate curve used in projecting future cash flows
if ProjectionCurve
is not specified, then RateSpec
is used both for discounting cash flows and projecting future cash flows (default) | structure
The rate curve to be used in projecting the future cash flows,
specified as the comma-separated pair consisting of 'ProjectionCurve'
and
a rate curve structure. This structure must be created using intenvset
. Use this optional input if
the forward curve is different from the discount curve.
Data Types: struct
Output Arguments
Price
— Prices for swaptions at time 0
vector
Prices for the swaptions at time 0, returned as a NINST
-by-1
vector
of prices.
More About
Call Swaption
A Call swaption or Payer swaption allows the option buyer to enter into an interest rate swap in which the buyer of the option pays the fixed rate and receives the floating rate.
Put Swaption
A Put swaption or Receiver swaption allows the option buyer to enter into an interest rate swap in which the buyer of the option receives the fixed rate and pays the floating rate.
Version History
Introduced in R2017aR2022b: Serial date numbers not recommended
Although swaptionbynormal
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 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 (한국어)