Documentation

This is machine translation

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

treepath

Entries from node of recombining binomial tree

Syntax

Values = treepath(Tree, BranchList)

Arguments

Tree

Recombining binomial tree.

BranchList

Number of paths (NUMPATHS) by path length (PATHLENGTH) matrix containing the sequence of branchings.

Description

Values = treepath(Tree, BranchList) extracts entries of a node of a recombining binomial tree. The node path is described by the sequence of branchings taken, starting at the root. The top branch is number one, the second-to-top is two, and so on. Set the branch sequence to zero to obtain the entries at the root node.

Values is a number of values (NUMVALS)-by-NUMPATHS matrix containing the retrieved entries of a recombining tree.

Examples

Create a BDT tree by loading the example file.

load deriv.mat; 

Then

FwdRates = treepath(BDTTree.FwdTree, [1 2 1]) 

returns the rates at the tree nodes located by taking the up branch, then the down branch, and finally the up branch again.

FwdRates = 

    1.1000
    1.0979
    1.1377
    1.1183 

You can visualize this with the treeviewer function.

treeviewer(BDTTree)

Related Examples

See Also

|

Introduced before R2006a

Was this topic helpful?