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).
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 NaNs.
Data Types: double
CFlowDates — Cash flow dates matrix
Cash flow dates, specified as NINST-by-MOSTCFS matrix.
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 of 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.
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:
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.