oasbyhw
Determine option adjusted spread using Hull-White model
Syntax
Description
[
calculates option adjusted spread using a Hull-White model.OAS
,OAD
,OAC
]
= oasbyhw(HWTree
,Price
,CouponRate
,Settle
,Maturity
,OptSpec
,Strike
,ExerciseDates
)
oasbyhw
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. For more
information, see More About.
Note
Alternatively, you can use oas
with an
OptionEmbeddedFixedBond
instrument using an IRTree
pricer
and a HullWhite
model. For more information, see Get Started with Workflows Using Object-Based Framework for Pricing Financial Instruments.
[
adds optional
name-value pair arguments.OAS
,OAD
,OAC
]
= oasbyhw(___,Name,Value
)
Examples
This example shows how to compute OAS and OAD using the Hull-White (HW) model using the following data.
ValuationDate = datetime(2010,10,25); Rates = [0.0355; 0.0382; 0.0427; 0.0489]; StartDates = ValuationDate; EndDates = datemnth(ValuationDate, 12:12:48)'; Compounding = 1; % define RateSpec RateSpec = intenvset('ValuationDate', ValuationDate,... 'StartDates', StartDates, 'EndDates', EndDates, ... 'Rates', Rates,'Compounding', Compounding); % specify VolsSpec and TimeSpec Sigma = 0.05; Alpha = 0.01; VS = hwvolspec(ValuationDate, EndDates, Sigma*ones(size(EndDates)),... EndDates, Alpha*ones(size(EndDates))); TS = hwtimespec(ValuationDate, EndDates, Compounding); % build the HW tree HWTree = hwtree(VS, RateSpec, TS); % instrument information CouponRate = 0.045; Settle = ValuationDate; Maturity = datetime(2014,10,25); OptSpec = 'call'; Strike = 100; ExerciseDates = [datetime(2010,10,25) ; datetime(2013,10,25)]; Period = 1; AmericanOpt = 0; Price = 97; % compute the OAS [OAS, OAD] = oasbyhw(HWTree, Price, CouponRate, Settle, Maturity,... OptSpec, Strike, ExerciseDates, 'Period', Period, 'AmericanOpt', AmericanOpt)
OAS = 2×1
52.3118
-12.8538
OAD = 2×1
3.5507
3.2910
This example shows how to compute the price of a callable bond using a Hull-White tree.
Use the following bond data:
Settle = datetime(2014,8,20); % Bond Properties Maturity = datetime(2034,4,1); CouponRate = .0625; CallDates = datemnth('01-Oct-2014',6*(0:19)); CallStrikes = [102.85 102.7 102.55 102.4 102.25 102.1 101.95 101.8 ... 101.65 101.5 101.35 101.2 101.05 100.9 100.75 100.6 100.45 100.3 ... 100.15 100];
Use the following zero-curve data:
CurveDates = datemnth(Settle,12*[1 2 3 5 7 10 20 30]'); ZeroRates = [.11 0.30 0.64 1.44 2.07 2.61 3.29 3.55]'/100;
Define the RateSpec
and build the HW tree.
RateSpec = intenvset('StartDate',Settle,'EndDates',CurveDates,'Rates',ZeroRates); % HW Model Properties alpha = .1; sigma = .01; TimeSpec = hwtimespec(Settle,cfdates(Settle,Maturity,12),2); VolSpec = hwvolspec(Settle,Maturity,sigma,Maturity,alpha); HWTree = hwtree(VolSpec,RateSpec,TimeSpec,'method','HW2000')
HWTree = struct with fields:
FinObj: 'HWFwdTree'
VolSpec: [1×1 struct]
TimeSpec: [1×1 struct]
RateSpec: [1×1 struct]
tObs: [0 0.0652 0.2295 0.3967 0.5628 0.7283 0.8967 1.0652 1.2295 1.3967 1.5628 1.7283 1.8967 2.0652 2.2295 2.3967 2.5628 2.7283 2.8967 3.0652 3.2295 3.3967 3.5628 3.7283 3.8967 4.0652 4.2295 4.3967 4.5628 4.7283 4.8967 5.0652 … ] (1×236 double)
dObs: [735831 735843 735873 735904 735934 735965 735996 736024 736055 736085 736116 736146 736177 736208 736238 736269 736299 736330 736361 736390 736421 736451 736482 736512 736543 736574 736604 736635 736665 736696 736727 … ] (1×236 double)
CFlowT: {1×236 cell}
Probs: {1×235 cell}
Connect: {1×235 cell}
FwdTree: {1×236 cell}
Compute the OAS for the bond.
Price = 103.25;
OAS = oasbyhw(HWTree, Price, CouponRate, Settle, Maturity, 'call', CallStrikes, CallDates)
OAS = 234.8209
If you want to compute an OAS that only measures the option cost, you can pass in an issuer-specific curve instead of a risk-free curve (this would be done in the RateSpec
argument).
This example shows how to compute the OAS for an amortizing callable bond using an HW lattice model.
Create a RateSpec
.
Rates = [0.035; 0.042147; 0.047345; 0.052707]; ValuationDate = 'Jan-1-2012'; StartDates = ValuationDate; EndDates = {'Jan-1-2013'; 'Jan-1-2014'; 'Jan-1-2015'; 'Jan-1-2016'}; Compounding = 1; RS = intenvset('ValuationDate', ValuationDate, 'StartDates', StartDates,... 'EndDates', EndDates,'Rates', Rates, 'Compounding', Compounding);
Build a HW tree.
VolDates = ['1-Jan-2013'; '1-Jan-2014'; '1-Jan-2015'; '1-Jan-2016']; VolCurve = 0.01; AlphaDates = '01-01-2016'; AlphaCurve = 0.1; HWVolSpec = hwvolspec(RS.ValuationDate, VolDates, VolCurve,... AlphaDates, AlphaCurve); HWTimeSpec = hwtimespec(RS.ValuationDate, EndDates, Compounding); HWT = hwtree(HWVolSpec, RS, HWTimeSpec);
Define the callable bond.
CouponRate = 0.05; Settle = 'Jan-1-2012'; Maturity = 'Jan-1-2016'; Period = 1; Face = { {'Jan-1-2014' 100; 'Jan-1-2015' 70; 'Jan-1-2016' 50}; }; OptSpec = 'call'; Strike = [97 95 93]; ExerciseDates ={'Jan-1-2014' 'Jan-1-2015' 'Jan-1-2016'};
Compute the OAS for a callable amortizing bond using the HW tree.
Price = 55; BondType = 'amortizing'; OAS = oasbyhw(HWT,Price, CouponRate, Settle, Maturity,... OptSpec, Strike, ExerciseDates, 'Period', Period, 'Face', Face,'BondType', BondType)
OAS = 2.4023e+03
This example shows how to compute the OAS for a stepped callable bond using an HW lattice model.
Create a RateSpec
for a zero curve using intenvset
.
Settle = datenum('15-Jun-2020'); ZeroRates = [0.0052 0.0055 0.0061 0.0073 0.0094 0.0119 0.0168 0.0222 0.0293 0.0307]'; ZeroDates = datemnth(Settle,[6 12*[1 2 3 4 5 7 10 20 30]]'); myRC = intenvset('Rates',ZeroRates,'StartDate',Settle,'EndDates',ZeroDates,... 'Basis',3,'Compounding',1);
Define the stepped callable bond.
CouponRate = {{'15-Jun-2025' .02;'15-Jun-2040' .03}}; Maturity = datetime(2040,6,15); Price = 90; ExerciseDates = [datetime(2034,6,15) datetime(2035,6,15) datetime(2036,6,15)]; Strikes = 100; Period = 1; OptSpec = 'call';
Build an HW tree using hwtree
.
AlphaHW = .1; VolHW = .01; myVolSpec = hwvolspec(Settle,Maturity,VolHW,Maturity,AlphaHW); myTimeSpec = hwtimespec(Settle,cfdates(Settle,Maturity,Period),Period); myHWTree = hwtree(myVolSpec,myRC,myTimeSpec);
Compute the OAS for a callable stepped bond using the HW tree.
[OAS,OAD,OAC] = oasbyhw(myHWTree,Price,CouponRate,Settle,Maturity,OptSpec,Strikes, ... ExerciseDates,'Period',Period)
OAS = 55.4323
OAD = 14.3161
OAC = 125.6324
Input Arguments
Interest-rate tree structure, specified by using hwtree
.
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 HW
tree. The bond argument Settle
is ignored.
To support existing code, oasbyhw
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, oasbyhw
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.
Data Types: char
| cell
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. Each row is the schedule for one option.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 is exercised between the underlying bondSettle
date and the single listed exercise date.
To support existing code, oasbyhw
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 = oasbybk(BDTTree,Price,CouponRate,Settle,Maturity,OptSpec,Strike,ExerciseDates,'Period',4)
Option type, specified as the comma-separated pair consisting of
'AmericanOpt'
and
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, oasbyhw
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, oasbyhw
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, oasbyhw
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, oasbyhw
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
Derivatives pricing options, specified as the comma-separated pair consisting of
'Options'
and a structure that is created with
derivset
.
Data Types: struct
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] Fabozzi, F. Handbook of Fixed Income Securities. 7th Edition. McGraw-Hill, 2005.
[2] Windas, T. Introduction to Option-Adjusted Spread Analysis. 3rd Edition. Bloomberg Press, 2007.
Version History
Introduced in R2011aAlthough oasbyhw
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
hwtree
| hwprice
| instoptembnd
| optembndbyhw
| oasbybdt
| oasbyhjm
| oasbybk
Topics
- Pricing Using Interest-Rate Tree Models
- Calibrating Hull-White Model Using Market Data
- Bond with Embedded Options
- Understanding Interest-Rate Tree Models
- Pricing Options Structure
- Supported Interest-Rate Instrument Functions
- Mapping Financial Instruments Toolbox Functions for Interest-Rate Instrument Objects
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)