cfbyhjm
Price cash flows from Heath-Jarrow-Morton interest-rate tree
Syntax
Description
Examples
Price a Portfolio Containing Two Cash Flow Instruments
Price a portfolio containing two cash flow instruments paying interest annually over the four-year period from January 1, 2000 to January 1, 2004.
Load the file deriv.mat
, which provides HJMTree
. The HJMTree
structure contains the time and interest-rate information needed to price the instruments.
load deriv.mat;
The valuation date (settle date) specified in HJMTree
is January 1, 2000 (date number 730486
).
HJMTree.RateSpec.ValuationDate
ans = 730486
Provide values for the other required arguments.
CFlowAmounts =[5 NaN 5.5 105; 5 0 6 105]; CFlowDates = [730852, NaN, 731582, 731947; 730852, 731217, 731582, 731947];
Use this information to compute the prices of the two cash flow instruments.
[Price, PriceTree] = cfbyhjm(HJMTree, CFlowAmounts,... CFlowDates, HJMTree.RateSpec.ValuationDate)
Price = 2×1
96.7805
97.2188
PriceTree = struct with fields:
FinObj: 'HJMPriceTree'
tObs: [0 1 2 3 4]
PBush: {[2x1 double] [2x1x2 double] [2x2x2 double] [2x4x2 double] [2x8 double]}
You can visualize the prices of the two cash flow instruments with the treeviewer
function.
Input Arguments
HJMTree
— Interest-rate tree structure
structure
Interest-rate tree structure, specified by using hjmtree
.
Data Types: struct
CFlowAmounts
— Cash flow amounts
matrix
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 NaN
s.
Data Types: double
CFlowDates
— Cash flow dates
serial date number
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
Settle
— Settlement date
serial date number | date character vector
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 HJM tree. The cash flow
argument, Settle
, is ignored.
Data Types: double
| char
Basis
— Day-count basis of instrument
0
(actual/actual) (default) | integer from 0
to 13
(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
Options
— Derivatives pricing options structure
structure
(Optional) Derivatives pricing options structure, specified
using derivset
.
Data Types: struct
Output Arguments
Price
— Expected prices at time 0
vector
Expected prices at time 0, returned as a NINST
-by-1
vector.
PriceTree
— Tree structure of instrument prices
structure
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.tObs
contains the observation times.PriceTree.PBush
contains the clean prices.
Version History
Introduced before R2006a
Commande MATLAB
Vous avez cliqué sur un lien qui correspond à cette commande MATLAB :
Pour exécuter la commande, saisissez-la dans la fenêtre de commande de MATLAB. Les navigateurs web ne supportent pas les commandes MATLAB.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- 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)