cfbyhw
Price cash flows from Hull-White interest-rate tree
Syntax
Description
Examples
Price 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 file deriv.mat, which provides HWTree.
The HWTree structure contains the time and interest-rate
information needed to price the instruments.
load deriv.mat; The valuation date (settle date) specified in HWTree is
January 1, 2004 (date number 731947).
HWTree.RateSpec.ValuationDate
ans =
731947Provide values for the other required arguments.
CFlowAmounts =[5 NaN 5.5 105; 5 0 6 105];
CFlowDates = [731947 NaN 732678 733043;
731947 732313 732678 733043];
Use this information to compute the prices of the two cash flow instruments.
[Price, PriceTree] = cfbyhw(HWTree, CFlowAmounts, CFlowDates,... HWTree.RateSpec.ValuationDate)
Price =
104.3334
104.8032
PriceTree =
struct with fields:
FinObj: 'HWPriceTree'
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 the treeviewer function.
Input Arguments
Interest-rate tree structure, specified by using hwtree.
Data Types: struct
Cash flow amounts, specified as a Number of instruments (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 than MOSTCFS cash
flows, the end of the row is padded with NaNs.
Data Types: double
Cash flow dates, specified as NINST-by-MOSTCFS vector
using serial date numbers. Each entry contains the serial date number of the
corresponding cash flow in CFlowAmounts.
Data Types: double
Settlement date, specified as a vector using serial date numbers or date character vectors.
The Settle date for every cash flow is set to the
ValuationDate of the HW tree. The cash flow argument,
Settle, is ignored.
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 = actual/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 = actual/360 (ICMA)
10 = actual/365 (ICMA)
11 = 30/360E (ICMA)
12 = actual/365 (ISDA)
13 = BUS/252
For more information, see Basis.
Data Types: double
(Optional) Derivatives pricing options structure, specified
using derivset.
Data Types: struct
Output Arguments
Expected prices at time 0, returned as a NINST-by-1 vector.
Tree structure of instrument prices, returned as a MATLAB® structure
of trees containing vectors of instrument prices and observation times
for each node. Within PriceTree:
PriceTree.PTreecontains the clean prices.PriceTree.tObscontains the observation times.PriceTree.Connectcontains the connectivity vectors. Each element in the cell array describes how nodes in that level connect to the next. For a given tree level, there areNumNodeselements 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.PriceTree.Probscontains the probability arrays. Each element of the cell array contains the up, middle, and down transition probabilities for each node of the level.
Version History
Introduced before R2006a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.
Amériques
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)