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
)
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 = datenum('20-Jan-2016'); 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 = datenum('20-Jan-2021'); Maturity = datenum('20-Jan-2026'); 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 = 'Jan-1-2010'; EndDates = 'Jan-1-2020'; Basis = 1; RateSpec = intenvset('ValuationDate', ValuationDate,'StartDates', ValuationDate, ... 'EndDates', EndDates, 'Rates', Rate, 'Compounding', Compounding, 'Basis', Basis);
Define the swaption.
ExerciseDate = datenum('20-Jan-2021'); Maturity = datenum('20-Jan-2026'); Settle = 'Jan-1-2010'; 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 = datenum('20-Jan-2016'); 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 = datenum('20-Jan-2021'); Maturity = datenum('20-Jan-2026'); 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
serial date number | date character vector | cell array of date character vectors | datetime object | string object
Settlement date (representing the settle date for each swaption),
specified as a NINST
-by-1
vector
of serial date numbers, or cell array of date character vectors, datetime
objects, or string objects. Settle
must not be
later than ExerciseDates
.
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.
Data Types: double
| char
| cell
| datetime
| string
ExerciseDates
— Dates on which swaption expires and underlying swap starts
serial date number | date character vector | cell array of date character vectors | datetime object
Dates on which the swaption expires and the underlying swap
starts, specified as a NINST
-by-1
vector
of serial date numbers, or cell array of date character vectors, datetime
objects, or string objects. There is only one ExerciseDate
on
the option expiry date. This is also the StartDate
of
the underlying forward swap.
Data Types: double
| char
| cell
| datetime
| string
Maturity
— Maturity date for each forward swap
serial date number | date character vector | cell array of date character vectors | datetime object
Maturity date for each forward swap, specified as a NINST
-by-1
vector
of dates using serial date numbers, cell array of date character vectors,
datetime objects, or string objects.
Data Types: double
| char
| cell
| datetime
| string
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
Abrir ejemplo
Tiene una versión modificada de este ejemplo. ¿Desea abrir este ejemplo con sus modificaciones?
Comando de MATLAB
Ha hecho clic en un enlace que corresponde a este comando de MATLAB:
Ejecute el comando introduciéndolo en la ventana de comandos de MATLAB. Los navegadores web no admiten comandos de 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)