The option-adjusted spread (OAS) is an amount of extra interest added above (or below if negative) the reference zero curve. To compute the OAS, you must provide the zero curve as an extra input. You can specify the zero curve in any intervals and with any compounding method. (To minimize any error due to interpolation, keep the intervals as regular and frequent as possible.) You must supply a prepayment vector or specify a speed corresponding to a standard PSA prepayment vector.
One way to compute the appropriate zero curve for an agency is to look at its bond yields and
bootstrap them from the shortest maturity onwards. You can do this with Financial Toolbox™ functions
The following example shows how to calculate an appropriate zero curve followed by computation of the pool's OAS. This example calculates the OAS of a 30-year fixed rate mortgage with about a 28-year weighted average maturity left, given an assumption of 0, 50, and 100 PSA prepayment speeds.
Create curve for
Bonds = [datenum('11/21/2002') 0 100 0 2 1; datenum('02/20/2003') 0 100 0 2 1; datenum('07/31/2004') 0.03 100 2 3 1; datenum('08/15/2007') 0.035 100 2 3 1; datenum('08/15/2012') 0.04875 100 2 3 1; datenum('02/15/2031') 0.05375 100 2 3 1]; Yields = [0.0162; 0.0163; 0.0211; 0.0328; 0.0420; 0.0501];
Since the above is Treasury data and not selected agency data, a term structure of spread is assumed. In this example, the spread declines proportionally from a maximum of 250 basis points at the shortest maturity.
Yields = Yields + 0.025 * (1./[1:6]')
Yields = 0.0412 0.0288 0.0294 0.0391 0.0470 0.0543
Get parameters from
Settle = datenum('20-Aug-2002'); Maturity = Bonds(:,1); CouponRate = Bonds(:,2); Face = Bonds(:,3); Period = Bonds(:,4); Basis = Bonds(:,5); EndMonthRule = Bonds(:,6); [Prices, AccruedInterest] = bndprice(Yields, CouponRate, ... Settle, Maturity, Period, Basis, EndMonthRule, , , , , ... Face)
Prices = 98.9747 98.5804 100.1040 98.1802 101.3808 99.2535 AccruedInterest = 0 0 0.1644 0.0479 0.0668 0.0736
zbtprice to solve
for zero rates.
[ZeroRatesP, CurveDatesP] = zbtprice(Bonds, Prices, Settle); ZeroCompounding = 2*ones(size(ZeroRatesP)); ZeroMatrix = [CurveDatesP, ZeroRatesP, ZeroCompounding]
ZeroMatrix = 1.0e+05 * 7.3154 0.0000 0.0000 7.3163 0.0000 0.0000 7.3216 0.0000 0.0000 7.3327 0.0000 0.0000 7.3510 0.0000 0.0000 7.4185 0.0000 0.0000
Use output from
zbtprice to calculate the OAS.
Price = 95; Settle = datenum('20-Aug-2002'); Maturity = datenum('2-Jan-2030'); IssueDate = datenum('2-Jan-2000'); GrossRate = 0.08125; CouponRate = 0.075; Delay = 14; Interpolation = 1; PrepaySpeed = [0; 50; 100]; OAS = mbsprice2oas(ZeroMatrix, Price, Settle, Maturity, ... IssueDate, GrossRate, CouponRate, Delay, Interpolation, ... PrepaySpeed)
OAS = 26.0502 28.6348 31.2222
This example shows that one cash flow set is being discounted
and solved for its OAS, as contrasted with the
of cash flows as shown in Mortgage Pool Valuation. Averaging the sets of cash flows
resulting from all simulations into one average cash flow vector and
solving for the OAS, discounts the averaged cash flows to have a present
value of today's (average) price.
While this example uses the mortgage pool price (
mbsprice2oas) to determine the OAS, you
can also use yield to resolve it (
Also, there are reverse OAS functions that return prices and yields
given OAS (
The example also restates earlier examples that show discount securities benefit from higher level of prepayment, keeping everything else unchanged. The relation is reversed for premium securities.