﻿

Accelerating the pace of engineering and science

# tr2bonds

Term-structure parameters given Treasury bond parameters

## Syntax

```[Bonds, Prices, Yields] = tr2bonds(TreasuryMatrix, Settle)
```

## Arguments

 TreasuryMatrix Treasury bond parameters. An n-by-5 matrix, where each row describes a Treasury bond. Columns are [CouponRate Maturity Bid Asked AskYield] where: CouponRate Coupon rate, as a decimal fraction. Maturity Maturity date, as a serial date number. Use datenum to convert date strings to serial date numbers. Bid Bid price based on \$100 face value. Asked Asked price based on \$100 face value. AskYield Asked yield to maturity, as a decimal fraction. Settle (Optional) Date string or serial date number of the settlement date for the analysis.

## Description

[Bonds, Prices, Yields] = tr2bonds(TreasuryMatrix, Settle) returns term-structure parameters (bond information, prices, and yields) sorted by ascending maturity date, given Treasury bond parameters. The formats of the output matrix and vectors meet requirements for input to the zbtprice and zbtyield zero-curve bootstrapping functions.

 Bonds Coupon bond information. An n-by-6 matrix where each row describes a bond. Columns are [Maturity CouponRate Face Period Basis EndMonthRule] where: Maturity Maturity date of the bond, as a serial date number. Use datestr to convert serial date numbers to date strings. CouponRate Coupon rate of the bond, as a decimal fraction. Face Redemption or face value of the bond, always 100. Period Coupons per year of the bond, always 2. Basis Day-count basis of the bond, possible values include:0 = actual/actual (default)1 = 30/360 (SIA)2 = actual/3603 = actual/365For more information, see basis. EndMonthRule End-of-month flag, always 1, meaning that a bond's coupon payment date is always the last day of the month. Prices Prices. Column vector containing the price of each bond in bonds, respectively. The number of rows (n) matches the number of rows in bonds. Yields Yields. Column vector containing the yield to maturity of each bond in bonds, respectively. The number of rows (n) matches the number of rows in bonds. If Settle is input, Yields is computed as a semiannual yield to maturity. If Settle is not input, the quoted input yields will be used.

## Examples

expand all

### Return Term-Structure Parameters Given Treasury Bond Parameters

This example shows how to return term-structure parameters (bond information, prices, and yields) sorted by ascending maturity date, given Treasury bond market parameters for December 22, 1997.

```Matrix =[0.0650 datenum('15-apr-1999')  101.03125 101.09375 0.0564
0.05125 datenum('17-dec-1998')  99.4375   99.5     0.0563
0.0625 datenum('30-jul-1998')  100.3125  100.375   0.0560
0.06125 datenum('26-mar-1998') 100.09375 100.15625 0.0546];

[Bonds, Prices, Yields] = tr2bonds(Matrix)
```
```Bonds =

1.0e+05 *

7.2984    0.0000    0.0010    0.0000         0    0.0000
7.2997    0.0000    0.0010    0.0000         0    0.0000
7.3011    0.0000    0.0010    0.0000         0    0.0000
7.3022    0.0000    0.0010    0.0000         0    0.0000

Prices =

100.1562
100.3750
99.5000
101.0938

Yields =

0.0546
0.0560
0.0563
0.0564

```