This example shows how to price a 4-year call and put swaption with receiving and paying legs using a BK interest-rate tree, assuming the interest rate is fixed at 7% annually. Build a tree with the following data.
Interest-rate tree structure, specified by using bktree.
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. For more information, see More About.
Data Types: char | cell
Strike — Strike swap rate values decimal
Strike swap rate values, specified as a NINST-by-1 vector.
Data Types: double
ExerciseDates — Exercise dates for swaption serial date number | date character vector | cell array of date character vectors
Exercise dates for the swaption, specified as a NINST-by-1 vector
or NINST-by-2 using serial date
numbers or date character vectors, depending on the option type.
For a European option, ExerciseDates are
a NINST-by-1 vector of exercise
dates. Each row is the schedule for one option. When using a European
option, there is only one ExerciseDate on the option
expiry date.
For an American option, ExerciseDates are
a NINST-by-2 vector of exercise
date boundaries. For each instrument, the option can be exercised
on any coupon date between or including the pair of dates on that
row. If only one non-NaN date is listed, or if ExerciseDates is NINST-by-1,
the option can be exercised between the ValuationDate of
the tree and the single listed ExerciseDate.
Data Types: double | char | cell
Spread — Number of basis points over reference rate numeric
Number of basis points over the reference rate, specified as
a NINST-by-1 vector.
Data Types: double
Settle — Settlement date serial date number | date character vector | cell array of date character vectors
Settlement date (representing the settle date for each swap), specified as a
NINST-by-1 vector of serial date numbers or
date character vectors. The Settle date for every swaption is set
to the ValuationDate of the BK tree. The swap argument
Settle is ignored. The underlying swap starts at the maturity of
the swaption.
Data Types: double | char
Maturity — Maturity date for swap serial date number | date character vector | cell array of date character vectors
Maturity date for each swap, specified as a NINST-by-1 vector
of dates using serial date numbers or date character vectors.
Data Types: double | char | cell
Name-Value Pair Arguments
Specify optional
comma-separated pairs of Name,Value arguments. Name is
the argument name and Value is the corresponding value.
Name must appear inside quotes. You can specify several name and value
pair arguments in any order as
Name1,Value1,...,NameN,ValueN.
'AmericanOpt' — Option type 0 (European) (default) | integer with values 0 or 1
(Optional) Option type, specified as the comma-separated pair consisting of
'AmericanOpt' and
NINST-by-1 positive integer flags with values:
0 — European
1 — American
Data Types: double
'SwapReset' — Reset frequency per year for underlying swap 1 (default) | numeric
Reset frequency per year for the underlying swap, specified as the comma-separated pair
consisting of 'SwapReset' and a
NINST-by-1 vector or
NINST-by-2 matrix representing the reset
frequency per year for each leg. If SwapReset 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 representing the basis used when annualizing the input forward rate tree for
each instrument, 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.
Price — Expected prices of swaptions at time 0 vector
Expected prices of the swaptions at time 0, returned as a NINST-by-1 vector.
PriceTree — Tree structure of instrument prices structure
Tree structure of instrument prices, returned as a MATLAB® structure
of trees containing vectors of swaption instrument prices and a vector
of observation times for each node. Within PriceTree:
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.
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.