cfbyzero

Price cash flows from set of zero curves

Description

example

Price= cfbyzero(RateSpec,CFlowAmounts,CFlowDates,Settle)prices cash flows from a set of zero curves.

example

Price= cfbyzero(___,Basis)adds an optional argument.

Examples

collapse all

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 filederiv.mat, which providesZeroRateSpec. TheZeroRateSpec结构包含的利率formation needed to price the instruments.

loadderiv.matCFlowAmounts =[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×196.7804 97.2187

Input Arguments

collapse all

安ualized zero rate term structure, specified by theRateSpecobtained fromintenvset. For information on the interest-rate specification, seeintenvset.

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 thanMOSTCFScash flows, the end of the row is padded withNaNs.

Data Types:double

Cash flow dates, specified asNINST-by-MOSTCFSmatrix. Each entry contains the serial date number of the corresponding cash flow inCFlowAmounts.

Data Types:double

Settlement date on which the cash flows are priced, specified using a scalar orNINST-by-1vector of serial date numbers or date character vectors of the same value which represent the settlement date for each cash flow.Settlemust be earlier thanMaturity.

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, seeBasis.

Data Types:double

Output Arguments

collapse all

Cash flow prices, returned as aNINST-by-NUMCURVESmatrix where each column arises from one of the zero curves.

Introduced before R2006a