oasbycir
Determine option adjusted spread using Cox-Ingersoll-Ross model
Syntax
Description
[
calculates the option adjusted spread from a Cox-Ingersoll-Ross (CIR) interest-rate tree
using a CIR++ model with the Nawalka-Beliaeva (NB) approach.OAS
,OAD
,OAC
]
= oasbycir(CIRTree
,Price
,CouponRate
,Settle
,Maturity
,OptSpec
,Strike
,ExerciseDates
)
oasbycir
computes prices of vanilla bonds with embedded options,
stepped coupon bonds with embedded options, amortizing bonds with embedded options, and
sinking fund bonds with embedded option. For more information, see More About.
[
adds optional name-value pair arguments.OAS
,OAD
,OAC
]
= oasbycir(___,Name,Value
)
Examples
Create a RateSpec
using the intenvset
function.
ValuationDate = datetime(2018,10,25); Rates = [0.0355; 0.0382; 0.0427; 0.0489]; StartDates = ValuationDate; EndDates = datemnth(ValuationDate, 12:12:48)'; 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 = datetime(2023,10,25); CIRTimeSpec = cirtimespec(ValuationDate, Maturity, NumPeriods); CIRVolSpec = cirvolspec(Sigma, Alpha, Theta); CIRT = cirtree(CIRVolSpec, RateSpec, CIRTimeSpec)
CIRT = struct with fields:
FinObj: 'CIRFwdTree'
VolSpec: [1×1 struct]
TimeSpec: [1×1 struct]
RateSpec: [1×1 struct]
tObs: [0 1.2500 2.5000 3.7500]
dObs: [737358 737814 738271 738727]
FwdTree: {[1.0454] [1.0952 1.0574 1.0312] [1.1706 1.1188 1.0802 1.0534 1.0376] [1.2285 1.1624 1.1110 1.0726 1.0460 1.0304 1.0252]}
Connect: {[3×1 double] [3×3 double] [3×5 double]}
Probs: {[3×1 double] [3×3 double] [3×5 double]}
Define the OAS instrument.
CouponRate = 0.045; Settle = ValuationDate; Maturity = '25-October-2019'; OptSpec = 'call'; Strike = 100; ExerciseDates = {'25-October-2018','25-October-2019'}; Period = 1; AmericanOpt = 0; Price = 97;
Compute the OAS.
[OAS,OAD] = oasbycir(CIRT,Price,CouponRate,Settle,Maturity,OptSpec,Strike,ExerciseDates,'Period',Period,'AmericanOpt',AmericanOpt)
OAS = 411.4425
OAD = 0.9282
his example shows how to compute the OAS for an amortizing callable bond using a CIR lattice model.
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(2016,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 = datetime(2019,1,1); CIRTimeSpec = cirtimespec(ValuationDate, Maturity, NumPeriods); CIRVolSpec = cirvolspec(Sigma, Alpha, Theta); CIRT = cirtree(CIRVolSpec, RateSpec, CIRTimeSpec)
CIRT = struct with fields:
FinObj: 'CIRFwdTree'
VolSpec: [1×1 struct]
TimeSpec: [1×1 struct]
RateSpec: [1×1 struct]
tObs: [0 0.7500 1.5000 2.2500]
dObs: [736330 736604 736878 737152]
FwdTree: {[1.0187] [1.0338 1.0188 1.0083] [1.0577 1.0380 1.0230 1.0124 1.0061] [1.0964 1.0716 1.0517 1.0364 1.0257 1.0193 1.0172]}
Connect: {[3×1 double] [3×3 double] [3×5 double]}
Probs: {[3×1 double] [3×3 double] [3×5 double]}
Define the callable bond.
BondSettlement = datetime(2016,1,1);
BondMaturity = datetime(2020,1,1);
CouponRate = 0.035;
Period = 1;
OptSpec = 'call';
Strike = 100;
Face = {
{datetime(2018,1,1) 100;
datetime(2019,1,1) 70;
datetime(2020,1,1) 50};
};
ExerciseDates = [datetime(2018,1,1) ; datetime(2019,1,1)];
Compute OAS for a callable amortizing bond using the CIR tree.
Price = 99; BondType = 'amortizing'; OAS = oasbycir(CIRT, Price, CouponRate, BondSettlement, Maturity,... OptSpec, Strike, ExerciseDates, 'Period', Period, 'Face', Face,'BondType', BondType)
OAS = 2×1
80.4801
84.3684
Input Arguments
Interest-rate tree structure, specified by using cirtree
.
Data Types: struct
Market prices of bonds with embedded options, specified as an
NINST
-by-1
vector.
Data Types: double
Bond coupon rate, specified as an NINST
-by-1
decimal annual rate.
Data Types: double
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 with an embedded option is set
to the ValuationDate
of the CIR tree. The bond argument
Settle
is ignored.
To support existing code, oasbycir
also
accepts serial date numbers as inputs, but they are not recommended.
Maturity date, specified as an NINST
-by-1
vector using a datetime array, string array, or date character vectors.
To support existing code, oasbycir
also
accepts serial date numbers as inputs, but they are not recommended.
Definition of option, specified as a
NINST
-by-1
cell array of character vectors or
string arrays with values 'call'
or
'put'
.
Data Types: char
| cell
| string
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
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, oasbycir
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: OAS =
oasbycir(CIRTree,Price,CouponRate,Settle,Maturity,OptSpec,Strike,ExerciseDates,'Period',4)
Option type, specified as the comma-separated pair consisting of
'AmericanOpt'
and a
NINST
-by-1
positive integer flags with values:
0
— European/Bermuda1
— American
Data Types: double
Coupons per year, specified as the comma-separated pair consisting of
'Period'
and a NINST
-by-1
vector.
Data Types: double
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
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
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, oasbycir
also
accepts serial date numbers as inputs, but they are not recommended.
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, oasbycir
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.
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, oasbycir
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.
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, oasbycir
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 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 using a datetime, string, or date character vector, and the
second column is associated face value. The date indicates the last day that the face
value is valid.
Data Types: double
| char
| string
| datetime
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
Option adjusted spread in basis points, returned as a
NINST
-by-1
vector.
Option adjusted duration, returned as a
NINST
-by-1
vector.
Option adjusted convexity, returned as a
NINST
-by-1
vector.
More About
Option adjusted spread (OAS) adjusts a bond spread for the option's value and is the standard measure for valuing and comparing bonds with different redemption structures.
OAS is a measure of yield spread that accounts for embedded call or put options in the valuation of bonds. The computation of OAS is similar to computing the bond spread, with the difference being that the cash flows are nondeterministic. In other words, the OAS computation considers the possibility of a change in the bond’s cash flows due to early redemptions. To compute an OAS, you must model the future behavior of interest rates.
In general, bonds with similar characteristics and credit risks should have the same OAS. If a bond has an OAS higher than the OAS of its peers (bond with similar characteristics and credit quality), it is considered undervalued. Conversely, a bond with a low OAS relative to its peers is considered overvalued.
Option adjusted duration (OAD) accounts for the effect of the call option on the expected life of a bond.
OAD weighs the probability that the bond will be called based on the spread between its coupon rate and its yield, as well as the volatility of interest rates. Generally speaking, option adjusted duration (OAD) is longer than modified duration when a bond is priced to a call date, and shorter than modified duration when a bond is priced to maturity.
Option adjusted convexity (OAC) is a measure of a bond's convexity, which account for the convexity of options embedded within the bond.
OAC captures the curvature of the price and yield relationship observed in bonds. Low values mean the relationship is near to linearity (a change in the price leads to a proportional change in the yield). The OAC can vary from the negative to the positive, depending on the yield’s amount and the time to call or time to put. In contrast with modified convexity, OAC assumes that the cash flows of a bond change when yields change.
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 R2018aAlthough oasbycir
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
| optbndbycir
| optfloatbycir
| optembndbycir
| optemfloatbycir
| rangefloatbycir
| swapbycir
| swaptionbycir
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)