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.

trintreeshape

Shape of recombining trinomial tree

Syntax

[NumLevels, NumPos, NumStates] = trintreeshape(TrinTree)

Arguments

TrinTree

Recombining price or interest-rate trinomial tree.

Description

[NumLevels, NumPos, NumStates] = trintreeshape(TrinTree) returns information on a recombining trinomial tree's shape.

NumLevels is the number of time levels of the tree.

NumPos is a 1-by-NUMLEVELS vector containing the length of the state vectors in each level.

NumStates is a 1-by-NUMLEVELS vector containing the number of state vectors in each level.

Examples

Create a Hull-White tree by loading the example file.

load deriv.mat; 

With treeviewer you can see the general shape of the HW interest-rate tree.

treeviewer(HWTree)

With this tree

[NumLevels, NumPos, NumStates] = trintreeshape(HWTree) 

returns

NumLevels  =   
     4

NumPos     =   
     1     1     1     1

NumStates =
     1     3     5     5

Related Examples

Introduced before R2006a

Was this topic helpful?