Mouseover text to see original. Click the button below to return to the English version of the page.
Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.
Translate This Page
MathWorks Machine Translation
The automated translation of this page is provided by a general purpose third party translator tool.
MathWorks does not warrant, and disclaims all liability for, the accuracy, suitability, or fitness for purpose of the translation.
This example shows how to 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 ZeroRateSpec. The ZeroRateSpec structure contains the interest-rate information needed to price the instruments.
RateSpec — Annualized zero rate term structure structure
Annualized zero rate term structure, specified by the RateSpec obtained
from intenvset. For information
on the interest-rate specification, see intenvset.
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 on which cash flows are priced serial date number | date character vector
Settlement date on which the cash flows are priced, specified
using a scalar or NINST-by-1 vector
of serial date numbers or date character vectors of the same value
which represent the settlement date for each cash flow. Settle must
be earlier than Maturity.
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.
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.