cfbyzero
Price cash flows from set of zero curves
Description
prices
cash flows from a set of zero curves.Price
= cfbyzero(RateSpec
,CFlowAmounts
,CFlowDates
,Settle
)
Examples
Compute the Price and Sensitivity From the Interest-Rate Term Structure
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.
load deriv.mat
CFlowAmounts =[5 NaN 5.5 105;5 0 6 105];
CFlowDates = [730852, NaN, 731582,731947;
730852, 731217, 731582, 731947];
Settle = 730486;
Price = cfbyzero(ZeroRateSpec, CFlowAmounts, CFlowDates, Settle)
Price = 2×1
96.7804
97.2187
Input Arguments
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 on which cash flows are priced
serial date number | date character vector
Settlement date on which the cash flows are priced, specified using a
NINST
-by-1
vector with 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.
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
Output Arguments
Price
— Cash flow prices
matrix
Cash flow prices, returned as a NINST
-by-NUMCURVES
matrix
where each column arises from one of the zero curves.
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.
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)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)