主要内容

cfbybk

价格现金流量来自Black-Karasinski利率树

Description

example

[价格,价格Tree] = cfbybk(Bktree,CFlowAmounts,CFlowDates,Settle)prices cash flows from a Black-Karasinski interest-rate tree.

example

[价格,价格Tree] = cfbybk(___,基础,Options)adds optional arguments.

Examples

collapse all

价格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 filederiv.mat, which providesBktree。这Bktree结构体contains the time and interest-rate information needed to price the instruments.

loadderiv.mat;

这valuation date (settle date) specified inBktreeis January 1, 2004 (date number731947).

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.

[价格,pricetree] = cfbybk(bktree,cflowamounts,cflowdates,。。。bktree.ratespec.valuationdate)
Warning: Not all cash flows are aligned with the tree. Result will be approximated. > In cfbytrintree (line 88) In cfbybk (line 75) Price = 93.3600 81.6218 PriceTree = struct with fields: FinObj: 'BKPriceTree' PTree: {[2×1 double] [2×3 double] [2×5 double] [2×5 double] [2×5 double]} tObs: [0 1 2 3 4] Connect: {[2] [2 3 4] [2 2 3 4 4]} Probs: {[3×1 double] [3×3 double] [3×5 double]}

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

Input Arguments

collapse all

Interest-rate tree structure, specified by usingbktree

Data Types:struct

现金流量金额,指定为许多工具(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 thanMOSTCFScash flows, the end of the row is padded withNaNs.

Data Types:double

现金流日期,指定为Ninst-经过-MOSTCFSmatrix. Each entry contains the serial date number of the corresponding cash flow inCFlowAmounts

Data Types:double

定居日期, specified as a vector of serial date numbers or date character vectors. TheSettledate for every cash flow is set to the评估日期of the BK tree. The cash flow argument,Settle,被忽略。

Data Types:double|char

(Optional) Day-count basis of the instrument, specified as a vector of integers.

  • 0 = actual/actual

  • 1 = 30/360 (SIA)

  • 2 =实际/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 =实际/360(ICMA)

  • 10 = actual/365 (ICMA)

  • 11 = 30/360E(ICMA)

  • 12 = actual/365 (ISDA)

  • 13 =巴士/252

For more information, see基础

Data Types:double

(Optional) Derivatives pricing options structure, specified using派生

Data Types:struct

Output Arguments

collapse all

Expected prices at time 0, returned as aNinst-经过-1向量。

Tree structure of instrument prices, returned as a MATLAB®结构体of trees containing vectors of instrument prices and observation times for each node. Within价格Tree:

  • 价格Tree.PTreecontains the clean prices.

  • 价格Tree.tObscontains the observation times.

  • pricetree.connect包含连接向量。单元格数组中的每个元素都描述了该级别中的节点如何连接到下一个。对于给定的树级,有NumNodeselements in the vector, and they contain the index of the node at the next level that the middle branch connects to. Subtracting 1 from that value indicates where the up-branch connects to, and adding 1 indicated where the down branch connects to.

  • 价格Tree.Probscontains the probability arrays. Each element of the cell array contains the up, middle, and down transition probabilities for each node of the level.

版本历史

在R2006a之前引入