optembndbycir
Price bonds with embedded options by Cox-Ingersoll-Ross interest-rate tree
Syntax
Description
[
calculates price for bonds with embedded options from a Cox-Ingersoll-Ross (CIR)
interest-rate tree and returns exercise probabilities in
Price
,PriceTree
]
= optembndbycir(CIRTree
,CouponRate
,Settle
,Maturity
,OptSpec
,Strike
,ExerciseDates
)PriceTree
.
optembndbycir
computes prices of vanilla bonds with embedded
options, stepped coupon bonds with embedded options, amortizing bonds with embedded
options, and sinking fund bonds with call embedded option using a CIR++ model with the
Nawalka-Beliaeva (NB) approach. For more information, see More About.
Note
Alternatively, you can use the OptionEmbeddedFixedBond
object to price bonds with embedded options. For
more information, see Get Started with Workflows Using Object-Based Framework for Pricing Financial Instruments.
[
adds optional name-value pair arguments.Price
,PriceTree
]
= optembndbycir(___,Name,Value
)
Examples
Price a Callable Bond Using a CIR Interest-Rate Tree
Create a RateSpec
using the intenvset
function.
Rates = [0.025; 0.032; 0.037; 0.042]; Dates = [datetime(2017,1,1) ; datetime(2018,1,1) ; datetime(2019,1,1) ; datetime(2020,1,1) ; datetime(2021,1,1)]; ValuationDate = datetime(2017,1,1); EndDates = Dates(2:end)'; Compounding = 1; RateSpec = intenvset('ValuationDate', ValuationDate, 'StartDates', ValuationDate, 'EndDates',EndDates,'Rates', Rates, 'Compounding', Compounding);
Create a CIR
tree.
NumPeriods = length(EndDates);
Alpha = 0.03;
Theta = 0.02;
Sigma = 0.1;
Maturity = '01-Jan-2018';
CIRTimeSpec = cirtimespec(ValuationDate, Maturity, NumPeriods);
CIRVolSpec = cirvolspec(Sigma, Alpha, Theta);
CIRT = cirtree(CIRVolSpec, RateSpec, CIRTimeSpec)
CIRT = struct with fields:
FinObj: 'CIRFwdTree'
VolSpec: [1x1 struct]
TimeSpec: [1x1 struct]
RateSpec: [1x1 struct]
tObs: [0 0.2500 0.5000 0.7500]
dObs: [736696 736787 736878 736969]
FwdTree: {[1.0062] [1.0090 1.0062 1.0039] [1.0123 1.0090 1.0062 1.0040 1.0022] [1.0161 1.0123 1.0090 1.0062 1.0040 1.0022 1.0010]}
Connect: {[3x1 double] [3x3 double] [3x5 double]}
Probs: {[3x1 double] [3x3 double] [3x5 double]}
Define the bond with embedded option instrument.
BondSettlement = datetime(2017,1,1);
BondMaturity = datetime(2020,1,1);
CouponRate = 0.035;
Period = 1;
OptSpec = 'put';
Strike = 100;
ExerciseDates = [datetime(2018,1,1) datetime(2019,1,1)];
Price the bond.
[Price,PriceTree] = optembndbycir(CIRT,CouponRate,BondSettlement,BondMaturity,OptSpec,... Strike,ExerciseDates,'AmericanOpt',1,'Period',1)
Price = 103.3099
PriceTree = struct with fields:
FinObj: 'CIRPriceTree'
tObs: [0 0.2500 0.5000 0.7500 1]
PTree: {[103.3099] [100.8043 102.9015 105.1046] [99.2640 100.5601 102.4488 104.6233 106.4110] [99.2426 99.6253 99.9581 102.1202 104.1685 105.7901 106.9640] [100 100 100 101.8914 103.7109 105.1487 106.1879]}
ProbTree: {[1] [0.2794 0.3750 0.3456] [0.0786 0.2095 0.3318 0.2592 0.1209] [0.0222 0.0885 0.1982 0.2678 0.2442 0.1360 0.0432] [0.0222 0.0885 0.1982 0.2678 0.2442 0.1360 0.0432]}
ExTree: {[0] [0 0 0] [0 0 0 0 0] [0 0 0 0 0 0 0] [1 1 1 0 0 0 0]}
ExProbTree: {[0] [0 0 0] [0 0 0 0 0] [0 0 0 0 0 0 0] [0.0222 0.0885 0.1982 0 0 0 0]}
ExProbsByTreeLevel: [0 0 0 0 0.3089]
Connect: {[3x1 double] [3x3 double] [3x5 double]}
Obtain Callable Bond Exercise Information Using a CIR Interest-Rate Tree Model
Create a CIRTree
with the following data:
Rates = [0.025; 0.027; 0.028; 0.03]; Dates = [datetime(2017,1,1) ; datetime(2018,1,1) ; datetime(2019,1,1) ; datetime(2020,1,1) ; datetime(2021,1,1)]; ValuationDate = datetime(2017,1,1); EndDates = Dates(2:end)'; Compounding = 1;
Create a RateSpec
.
RateSpec = intenvset('ValuationDate', ValuationDate, 'StartDates', ValuationDate, 'EndDates',EndDates,... 'Rates', Rates, 'Compounding', Compounding);
Build the CIR tree with the following data.
NumPeriods = length(EndDates); Alpha = 0.03; Theta = 0.02; Sigma = 0.1; Maturity = datetime(2018,1,1); CIRTimeSpec = cirtimespec(ValuationDate, Maturity, NumPeriods); CIRVolSpec = cirvolspec(Sigma, Alpha, Theta); CIRT = cirtree(CIRVolSpec, RateSpec, CIRTimeSpec);
Define the callable bond instruments.
Settle = datetime(2017,1,1);
Maturity = [datetime(2018,1,1) ; datetime(2020,1,1)];
CouponRate = {{datetime(2019,1,1) .0325;datetime(2020,1,1) .0375}};
OptSpec='call';
Strike= [100;110];
ExerciseDates= [datetime(2018,1,1) ; datetime(2020,1,1)];
Price the instruments.
[Price, PriceTree]= optembndbycir(CIRT, CouponRate, Settle, Maturity, OptSpec, Strike,... ExerciseDates, 'Period', 1,'AmericanOpt',1)
Price = 2×1
98.1718
102.6458
PriceTree = struct with fields:
FinObj: 'CIRPriceTree'
tObs: [0 0.2500 0.5000 0.7500 1]
PTree: {[2x1 double] [2x3 double] [2x5 double] [2x7 double] [2x7 double]}
ProbTree: {[1] [0.2794 0.3750 0.3456] [0.0786 0.2095 0.3318 0.2592 0.1209] [0.0222 0.0885 0.1982 0.2678 0.2442 0.1360 0.0432] [0.0222 0.0885 0.1982 0.2678 0.2442 0.1360 0.0432]}
ExTree: {[2x1 double] [2x3 double] [2x5 double] [2x7 double] [2x7 double]}
ExProbTree: {[2x1 double] [2x3 double] [2x5 double] [2x7 double] [2x7 double]}
ExProbsByTreeLevel: [2x5 double]
Connect: {[3x1 double] [3x3 double] [3x5 double]}
Examine the output PriceTree.ExTree
. PriceTree.ExTree
contains the exercise indicator arrays. Each element of the cell array is an array containing 1
's where an option is exercised and 0
's where it is not.
PriceTree.ExTree{4}
ans = 2×7
0 0 0 0 0 0 0
0 0 0 0 0 0 0
There is no exercise for instrument 1 or instrument 2.
PriceTree.ExTree{3}
ans = 2×5
0 0 0 0 0
0 0 0 0 0
There is no exercise for instrument 1 or instrument 2.
PriceTree.ExTree{2}
ans = 2×3
0 0 0
0 0 0
There is exercise for instrument 1 or instrument 2.
Next view the probability of reaching each node from the root node using PriceTree.ProbTree
.
PriceTree.ProbTree{2}
ans = 1×3
0.2794 0.3750 0.3456
PriceTree.ProbTree{3}
ans = 1×5
0.0786 0.2095 0.3318 0.2592 0.1209
PriceTree.ProbTree{4}
ans = 1×7
0.0222 0.0885 0.1982 0.2678 0.2442 0.1360 0.0432
Then view the exercise probabilities using PriceTree.ExProbTree
. PriceTree.ExProbTree
contains the exercise probabilities. Each element in the cell array is an array containing 0
's where there is no exercise, or the probability of reaching that node where exercise happens.
PriceTree.ExProbTree{4}
ans = 2×7
0 0 0 0 0 0 0
0 0 0 0 0 0 0
PriceTree.ExProbTree{3}
ans = 2×5
0 0 0 0 0
0 0 0 0 0
PriceTree.ExProbTree{2}
ans = 2×3
0 0 0
0 0 0
View the exercise probabilities at each tree level using PriceTree.ExProbsByTreeLevel
. PriceTree.ExProbsByTreeLevel
is an array with each row holding the exercise probability for a given option at each tree observation time.
PriceTree.ExProbsByTreeLevel
ans = 2×5
0 0 0 0 0
0 0 0 0 0
Input Arguments
CIRTree
— Interest-rate tree structure
structure
Interest-rate tree structure, specified by using cirtree
.
Data Types: struct
CouponRate
— Bond coupon rate
positive decimal value
Bond coupon rate, specified as an NINST
-by-1
decimal annual rate or NINST
-by-1
cell array,
where each element is a NumDates
-by-2
cell
array. The first column of the NumDates
-by-2
cell array is dates and the second column is associated rates. The date indicates the
last day that the coupon rate is valid.
Data Types: double
| cell
Settle
— Settlement date
datetime array | string array | date character vector
Settlement date for the bond option, specified as a
NINST
-by-1
vector using a datetime array, string
array, or date character vectors.
Note
The Settle
date for every bond is set to the
ValuationDate
of the CIR tree. The bond argument
Settle
is ignored.
To support existing code, optembndbycir
also
accepts serial date numbers as inputs, but they are not recommended.
Maturity
— Maturity date
datetime array | string array | date character vector
Maturity date, specified as an NINST
-by-1
vector using a datetime array, string array, or date character vectors.
To support existing code, optembndbycir
also
accepts serial date numbers as inputs, but they are not recommended.
OptSpec
— Definition of option
character vector with value 'call'
or 'put'
| cell array of character vectors with values 'call'
or 'put'
| string array with value "call"
or
"put"
Definition of option, specified as a
NINST
-by-1
cell array of character vectors or
string arrays with a value of 'call'
or
'put'
.
Data Types: char
| cell
| string
Strike
— Option strike price values
nonnegative integer
Option strike price value, specified as a
NINST
-by-1
or
NINST
-by-NSTRIKES
depending on the type of option:
European option —
NINST
-by-1
vector of strike price values.Bermuda option —
NINST
by number of strikes (NSTRIKES
) matrix of strike price values. Each row is the schedule for one option. If an option has fewer thanNSTRIKES
exercise opportunities, the end of the row is padded withNaN
s.American option —
NINST
-by-1
vector of strike price values for each option.
Data Types: double
ExerciseDates
— Option exercise dates
datetime array | string array | date character vector
Option exercise dates, specified as a
NINST
-by-1
,
NINST
-by-2
, or
NINST
-by-NSTRIKES
vector using a datetime array,
string array, or date character vectors, depending on the type of option:
For a European option, use a
NINST
-by-1
vector of dates. For a European option, there is only oneExerciseDates
on the option expiry date.For a Bermuda option, use a
NINST
-by-NSTRIKES
vector of dates.For an American option, use a
NINST
-by-2
vector of exercise date boundaries. The option can be exercised on any date between or including the pair of dates on that row. If only one non-NaN
date is listed, or ifExerciseDates
is aNINST
-by-1
vector, the option can be exercised betweenValuationDate
of the stock tree and the single listedExerciseDates
.
To support existing code, optembndbycir
also
accepts serial date numbers as inputs, but they are not recommended.
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,PriceTree] =
optembndbycir(BDTTree,CouponRate,Settle,Maturity,OptSpec,Strike,ExerciseDates,'Period',1,'AmericanOpt',1)
AmericanOpt
— Option type
0
European/Bermuda (default) | integer with values 0
or 1
Option type, specified as the comma-separated pair consisting of
'AmericanOpt'
and an
NINST
-by-1
positive integer flags with values:
0
— European/Bermuda1
— American
Data Types: double
Period
— Coupons per year
2
per year (default) | vector
Coupons per year, specified as the comma-separated pair consisting of
'Period'
and a NINST
-by-1
vector.
Data Types: double
Basis
— Day-count basis
0
(actual/actual) (default) | integer from 0
to 13
Day-count basis, specified as the comma-separated pair consisting of
'Basis'
and a NINST
-by-1
vector of integers.
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
EndMonthRule
— End-of-month rule flag
1
(in effect) (default) | nonnegative integer with values 0
or 1
End-of-month rule flag, specified as the comma-separated pair consisting of
'EndMonthRule'
and a nonnegative integer using a
NINST
-by-1
vector. This rule applies only when
Maturity
is an end-of-month date for a month having 30 or fewer days.
0
= Ignore rule, meaning that a bond coupon payment date is always the same numerical day of the month.1
= Set rule on, meaning that a bond coupon payment date is always the last actual day of the month.
Data Types: double
IssueDate
— Bond issue date
datetime array | string array | date character vector
Bond issue date, specified as the comma-separated pair consisting of
'IssueDate'
and a
NINST
-by-1
vector using a datetime array,
string array, or date character vectors.
To support existing code, optembndbycir
also
accepts serial date numbers as inputs, but they are not recommended.
FirstCouponDate
— Irregular first coupon date
datetime array | string array | date character vector
Irregular first coupon date, specified as the comma-separated pair consisting of
'FirstCouponDate'
and a
NINST
-by-1
vector using a datetime array,
string array, or date character vectors.
To support existing code, optembndbycir
also
accepts serial date numbers as inputs, but they are not recommended.
When FirstCouponDate
and LastCouponDate
are both specified, FirstCouponDate
takes precedence in
determining the coupon payment structure. If you do not specify a
FirstCouponDate
, the cash flow payment dates are determined
from other inputs.
LastCouponDate
— Irregular last coupon date
datetime array | string array | date character vector
Irregular last coupon date, specified as the comma-separated pair consisting of
'LastCouponDate'
and a
NINST
-by-1
vector using a datetime array,
string array, or date character vectors.
To support existing code, optembndbycir
also
accepts serial date numbers as inputs, but they are not recommended.
In the absence of a specified FirstCouponDate
, a specified
LastCouponDate
determines the coupon structure of the bond. The
coupon structure of a bond is truncated at the LastCouponDate
,
regardless of where it falls, and is followed only by the bond's maturity cash flow
date. If you do not specify a LastCouponDate
, the cash flow
payment dates are determined from other inputs.
StartDate
— Forward starting date of payments
datetime array | string array | date character vector
Forward starting date of payments (the date from which a bond cash flow is
considered), specified as the comma-separated pair consisting of
'StartDate'
and a
NINST
-by-1
vector using a datetime array,
string array, or date character vectors.
To support existing code, optembndbycir
also
accepts serial date numbers as inputs, but they are not recommended.
If you do not specify StartDate
, the effective start date is
the Settle
date.
Face
— Face value
100
(default) | NINST
-by-1
vector | NINST
-by-1
cell array
Face or par value, specified as the comma-separated pair consisting of
'Face'
and a NINST
-by-1
vector or a NINST
-by-1
cell array where each
element is a NumDates
-by-2
cell array where the
first column is dates and the second column is associated face value. The date
indicates the last day that the face value is valid.
Note
Instruments without a Face
schedule are treated as either
vanilla bonds or stepped coupon bonds with embedded options.
Data Types: double
BondType
— Type of underlying bond
'vanilla'
for scalar Face
values, 'callablesinking'
for scheduled Face
values (default) | cell array of character vectors with values
'vanilla'
,'amortizing'
, or
'callablesinking'
| string array with values "vanilla"
,
"amortizing"
, or "callablesinking"
Type of underlying bond, specified as the comma-separated pair consisting of
'BondType'
and a NINST
-by-1
cell array of character vectors or string array specifying if the underlying is a
vanilla bond, an amortizing bond, or a callable sinking fund bond. The supported types are:
'vanilla
' is a standard callable or puttable bond with a scalarFace
value and a single coupon or stepped coupons.'callablesinking'
is a bond with a schedule ofFace
values and a sinking fund call provision with a single or stepped coupons.'amortizing'
is an amortizing callable or puttable bond with a schedule ofFace
values with single or stepped coupons.
Data Types: char
| string
Output Arguments
Price
— Expected prices of embedded option at time 0
matrix
Expected price of the embedded option at time 0
, returned as a
NINST
-by-1
matrix.
PriceTree
— Structure containing trees of vectors of instrument prices and exercise probabilities for each node
structure
Structure containing trees of vectors of instrument prices, a vector of observation times for each node, and exercise probabilities. Values are:
PriceTree.tObs
contains the observation times.PriceTree.PTree
contains the clean prices.PriceTree.Connect
contains the connectivity vectors. Each element in the cell array describes how nodes in that level connect to the next. For a given tree level, there areNumNodes
elements in the vector, and they contain the index of the node at the next level that the middle branch connects to. Subtracting 1 from that value indicates where the up-branch connects to, and adding 1 indicated where the down branch connects to.PriceTree.ExTree
contains the exercise indicator arrays. Each element of the cell array is an array containing1
's where an option is exercised and0
's where it isn't.PriceTree.ProbTree
contains the probability of reaching each node from root node.PriceTree.ExProbTree
contains the exercise probabilities. Each element in the cell array is an array containing0
's where there is no exercise, or the probability of reaching that node where exercise happens.PriceTree.ExProbsByTreeLevel
is an array with each row holding the exercise probability for a given option at each tree observation time.
More About
Vanilla Bond with Embedded Option
A vanilla coupon bond is a security representing an obligation to repay a borrowed amount at a designated time and to make periodic interest payments until that time.
The issuer of a bond makes the periodic interest payments until the bond matures. At maturity, the issuer pays to the holder of the bond the principal amount owed (face value) and the last interest payment. A vanilla bond with an embedded option is where an option contract has an underlying asset of a vanilla bond.
Stepped Coupon Bond with Callable and Puttable Features
A step-up and step-down bond is a debt security with a predetermined coupon structure over time.
With these instruments, coupons increase (step up) or decrease (step down) at specific times during the life of the bond. Stepped coupon bonds can have options features (calls and puts).
Sinking Fund Bond with Call Embedded Option
A sinking fund bond is a coupon bond with a sinking fund provision.
This provision obligates the issuer to amortize portions of the principal prior to maturity, affecting bond prices since the time of the principal repayment changes. This means that investors receive the coupon and a portion of the principal paid back over time. These types of bonds reduce credit risk, since it lowers the probability of investors not receiving their principal payment at maturity.
The bond may have a sinking fund call option provision allowing the issuer to retire the sinking fund obligation either by purchasing the bonds to be redeemed from the market or by calling the bond via a sinking fund call, whichever is cheaper. If interest rates are high, then the issuer buys back the requirement amount of bonds from the market since bonds are cheap, but if interest rates are low (bond prices are high), then most likely the issuer is buying the bonds at the call price. Unlike a call feature, however, if a bond has a sinking fund call option provision, it is an obligation, not an option, for the issuer to buy back the increments of the issue as stated. Because of this, a sinking fund bond trades at a lower price than a non-sinking fund bond.
Amortizing Callable or Puttable Bond
Amortizing callable or puttable bonds work under a scheduled
Face
.
An amortizing callable bond gives the issuer the right to call back the bond, but
instead of paying the Face
amount at maturity, it repays part of the
principal along with the coupon payments. An amortizing puttable bond, repays part of the
principal along with the coupon payments and gives the bondholder the right to sell the bond
back to the issuer.
References
[1] Cox, J., Ingersoll, J., and S. Ross. "A Theory of the Term Structure of Interest Rates." Econometrica. Vol. 53, 1985.
[2] Brigo, D. and F. Mercurio. Interest Rate Models - Theory and Practice. Springer Finance, 2006.
[3] Hirsa, A. Computational Methods in Finance. CRC Press, 2012.
[4] Nawalka, S., Soto, G., and N. Beliaeva. Dynamic Term Structure Modeling. Wiley, 2007.
[5] Nelson, D. and K. Ramaswamy. "Simple Binomial Processes as Diffusion Approximations in Financial Models." The Review of Financial Studies. Vol 3. 1990, pp. 393–430.
Version History
Introduced in R2018aR2022b: Serial date numbers not recommended
Although optembndbycir
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.
See Also
bondbycir
| capbycir
| cfbycir
| fixedbycir
| floatbycir
| floorbycir
| oasbycir
| optbndbycir
| optfloatbycir
| optemfloatbycir
| rangefloatbycir
| swapbycir
| swaptionbycir
| instoptembnd
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 (한국어)