%% Convert a Hull-White Tree Using Inverse-Discount Notation
% Convert a Hull-White tree using inverse-discount notation to a Hull-White tree displaying interest-rate notation.

load deriv.mat;
HWTree
HWTree.FwdTree{1}
HWTree.FwdTree{2}

% Use treeviewer to display the path of interest rates expressed in inverse-discount notation.

treeviewer(HWTree)

% Use cvtree to convert the inverse-discount notation to interest-rate notation.

RTree = cvtree(HWTree)
RTree.RateTree{1}
RTree.RateTree{2}

% use treeviewer to display the converted tree, showing the path of interest rates expressed as forward rates.

treeviewer(RTree)

% Copyright 2020 The MathWorks, Inc.