Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

tr2bonds

Term-structure parameters given Treasury bond parameters

Syntax

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

Arguments

TreasuryMatrix

Treasury bond parameters. TreasuryMatrix can be specified as a table or a n-by-5 matrix. When TreasuryMatrix is a table, the Maturity dates can be specified as either serial date numbers, date character vectors, or datetime arrays. If TreasuryMatrix is an n-by-5 matrix, then 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 character vectors to serial date numbers. If TreasuryMatrix is a table, the Maturity dates can be specified as either serial date numbers, date character vectors, or datetime arrays.

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, specified as a serial date number, date character vector, or datetime array, 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. Bonds can be a table or matrix depending on the TreasuryMatrix input. When TreasuryMatrix is a table, Bonds will also be a table, and the variable type for the Maturity dates in Bonds (column 1) will match the variable type for Maturity in TreasuryMatrix. When TreasuryMatrix input is a n-by-6 matrix, then 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 character vectors. When TreasuryMatrix is a table, the variable type for the Maturity dates in Bonds (column 1) will match the variable type for Maturity in TreasuryMatrix.

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/360

  • 3 = actual/365

For 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 are used.

Examples

collapse all

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

This example shows how to use datetime input 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];

t=array2table(Matrix);
t.Matrix2=datetime(t{:,2},'ConvertFrom','datenum','Locale','en_US');
[Bonds, Prices, Yields] = tr2bonds(t,datetime('1-Jan-1997','Locale','en_US'))
Bonds = 4×6 table
     Maturity      CouponRate    Face    Period    Basis    EndMonthRule
    ___________    __________    ____    ______    _____    ____________

    26-Mar-1998    0.06125       100     2         0        1           
    30-Jul-1998     0.0625       100     2         0        1           
    17-Dec-1998    0.05125       100     2         0        1           
    15-Apr-1999      0.065       100     2         0        1           

Prices = 

  100.1562
  100.3750
   99.5000
  101.0938

Yields = 

    0.0598
    0.0599
    0.0540
    0.0598

Introduced before R2006a

Was this topic helpful?