Main Content

树木的图形表示

Introduction

您可以使用该功能TreeViewer要显示树的图形表示,使您可以在树节点上进行交互性检查直到成熟的价格和费率。要开始此过程,请首先加载数据文件deriv.mat包含在此工具箱中。

加载deriv.mat

笔记

TreeViewerprice tree diagrams follow the convention that increasing prices appear on the upper branch of a tree and, consequently, decreasing prices appear on the lower branch. Conversely, for interest rate displays,decreasing利率出现在上部分支(价格上涨)和增加interest rates on the lower branch (prices are falling).

有关使用的信息TreeViewerto observe interest rate movement, see观察利率。For information on usingTreeViewer要观察价格的行动,请参阅观察仪器价格

观察利率

If you provide the name of an interest rate tree to theTreeViewer功能,它显示了利率路径的图形视图。例如,这是TreeViewerrepresentation of all the rates along both the up and down branches ofhjmtree

TreeViewer(HJMTree)

示例在隔离特定节点usedbushpath通过将第一个分支向上取下,然后将两个分支沿速率树沿HJM树找到远程速率的路径。

弗拉特= bushpath(hjmtree.fwdtree,[1 2 2])
FRates = 1.0356 1.0364 1.0526 1.0674

和theTreeViewerfunction you can display the identical information by clicking along the same sequence of nodes, as shown next.

Next is aTreeViewer沿着多个分支的利率表示BDTTree

TreeViewer(bdttree)

笔记

使用时TreeViewer通过重新组合树木(例如BDT,BK和HW),您必须从头到尾连续单击每个节点。因为这些树可以重组TreeViewer无法自动完成路径。

示例在隔离特定节点usedTreepath为了找到利率的路径,将第一个分支提升到速率树,然后两个分支。

FRates = treepath(BDTTree.FwdTree, [1 2 2])
FRates = 1.1000 1.0979 1.1377 1.1606

您可以通过单击相同的节点序列来显示相同​​的信息,如下所示。

观察仪器价格

使用TreeViewerto display a tree of instrument prices, provide the name of an instrument set along with the name of a price tree in your call toTreeViewer, for example:

加载deriv.mat[PRICE,PRICETREE] = HJMPRICE(HJMTREE,HJMINSTSET);TreeViewer(pricetree,hjminstset)

TreeViewer您选择each instrument individuallyin the instrument portfolio for display.

您可以使用类似的过程根据包含的BDT利率树查看仪器价格deriv.mat

加载deriv.mat[bdtprice,bdtpricetree] = bdtprice(bdttree,bdtinstset);TreeViewer(bdtpricetree,bdtinstset)

Valuation Date Prices

You can useTreeViewerinstrument-by-instrument to observe instrument prices through time. For the first 4% bond in the HJM instrument portfolio,TreeViewerindicates a valuation date price of 98.72, the same value obtained by accessing thePricetree直接结构。

作为一个进一步的例子,看看at the sixth instrument in the price vector, the 3% cap. At the valuation date, its value obtained directly from the structure is 6.2831. UseTreeViewer在此工具上确认这个价格。

额外的观察时间

The second node represents the first-rate observation time,TOB = 1。该节点显示两个状态,一个表示分支上升,另一个表示分支向下。

检查与UP分支相对应的节点的价格。

pricetree.pbush {2}(:,::,1)
ANS = 100.1563 99.7309 0.1007 100.1563 100.3782 3.2594 0.1007 3.5597

和以前一样,您可以使用TreeViewer,这次检查UP分支机构的4%债券的价格。TreeViewerdisplays a price of 100.2 for the first node of the up branch, as expected.

现在检查相应的下属分支。

Pricetree。PBush{2}(:,:,2)
ANS = 96.3041 94.1986 0 96.3041 100.3671 8.6342 0 -0.3923

UseTreeViewer再一次,现在观察下向分支机构的4%债券的价格。显示的价格为96.3的价格符合从直接访问获得的价格Pricetree结构体。您可以根据需要继续沿着价格树继续此过程。

也可以看看

|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

相关示例

更多关于