cfbybk

Price cash flows from Black-Karasinski interest-rate tree

Syntax

[Price, PriceTree] = cfbybk(BKTree, CFlowAmounts, CFlowDates,
Settle, Basis, Options)

Arguments

BKTree

Forward-rate tree structure created by bktree.

CFlowAmounts

Number of instruments (NINST) by maximum number of cash flows (MOSTCFS) matrix of cash flow amounts. Each row is a list of cash flow values for one instrument. If an instrument has fewer than MOSTCFS cash flows, the end of the row is padded with NaNs.

CFlowDates

NINST-by-MOSTCFS matrix of cash flow dates. Each entry contains the serial date number of the corresponding cash flow in CFlowAmounts.

Settle

Settlement date. A vector of serial date numbers or date strings. The Settle date for every cash flow is set to the ValuationDate of the BK tree. The cash flow argument, Settle, is ignored.

Basis

(Optional) Day-count basis of the instrument. A vector of integers.

  • 0 = actual/actual (default)

  • 1 = 30/360 (SIA)

  • 2 = actual/360

  • 3 = actual/365

  • 4 = 30/360 (BMA)

  • 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/actual (ISDA)

  • 13 = BUS/252

For more information, see basis.

Options

(Optional) Derivatives pricing options structure created with derivset.

Description

[Price, PriceTree] = cfbybk(BKTree, CFlowAmounts, CFlowDates,
Settle, Basis, Options)
prices cash flows from a Black-Karasinski interest-rate tree.

Price is an NINST-by-1 vector of expected prices at time 0.

PriceTree is a tree structure with a vector of instrument prices at each node.

Examples

Price a portfolio containing two cash flow instruments paying interest annually over the four-year period from January 1, 2005 to January 1, 2009.

Load the file deriv.mat, which provides BKTree. The BKTree structure contains the time and interest-rate information needed to price the instruments.

load deriv.mat; 

The valuation date (settle date) specified in BKTree is January 1, 2004 (date number 731947).

BKTree.RateSpec.ValuationDate
ans =

      731947

Provide values for the other required arguments.

CFlowAmounts =[5 NaN 5.5 105; 5 0 6 105];
CFlowDates = [732678, NaN, 733408,733774; 
              732678, 733034, 733408, 734774];

Use this information to compute the prices of the two cash flow instruments.

[Price, PriceTree] = cfbybk(BKTree, CFlowAmounts, CFlowDates,... 
BKTree.RateSpec.ValuationDate)
Price =

   93.3600
   81.6218

PriceTree = 

    FinObj: 'BKPriceTree'
       tObs: [0 1 2 3 4]
      PTree: {[2x1 double]  [2x3 double]  [2x5 double]  [2x5 
double]                [2x5 double]}
    Connect: {[2]  [2 3 4]  [2 2 3 4 4]}
      Probs: {[3x1 double]  [3x3 double]  [3x5 double]}

You can visualize the prices of the two cash flow instruments with the treeviewer function.

treeviewer(PriceTree)

See Also

| | |

Was this topic helpful?