Documentation Center

  • Trial Software
  • Product Updates

cfspread

Compute spread over yield curve for cash flow

Syntax

Spread = cfspread(RateSpec, Price, CFAmounts,
CFDates, Settle)
Spread = cfspread(RateSpec, Price, CFAmounts,
CFDates, Settle, Name,Value)

Description

Spread = cfspread(RateSpec, Price, CFAmounts,
CFDates, Settle)
computes spread over a yield curve for a cash flow.

Spread = cfspread(RateSpec, Price, CFAmounts,
CFDates, Settle, Name,Value)
computes spread over a yield curve for a cash flow with additional options specified by one or more Name,Value pair arguments.

Input Arguments

RateSpec

Interest-rate specification for the initial risk free rate curve. See intenvset for information on declaring an interest-rate variable.

Price

Price of cash flows.

CFlowAmounts

NINST-by-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.

CFlowDates

NINST-by-MOSTCFS matrix of cash flow dates. Each entry contains the serial date of the corresponding cash flow in CFlowAmounts.

Settle

Settlement date is a serial date number or date string. Settlement date is the date on which the cash flows are priced.

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

    Note:   Any optional input of size N-by-1 is also acceptable as an array of size 1-by-N, or as a single value applicable to all contracts. Single values are internally expanded to an array of size N-by-1.

'Basis'

N-by-1 vector of day-count basis:

  • 0 = actual/actual

  • 1 = 30/360 (SIA)

  • 2 = actual/360

  • 3 = actual/365

  • 4 = 30/360 (BMA)

  • 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/actual (ISDA)

  • 13 = BUS/252

For more information, see basis.

Default: 0 (actual/actual)

'CompFreq'

Compounding frequency. By default, SIA bases (0-7) and BUS/252 use a semi-annual compounding convention and ISMA bases (8-12) use an annual compounding convention.

Default: actual

Output Arguments

Spread

Spread of cash flows over a zero curve.

Examples

expand all

Compute Spread Over a Yield Curve for a Cash Flow

Use cfspread to compute the spread over a yield curve for a cash flow.

Define data for the yield curve.

Settle = datenum('01-Jul-2003');
CurveDates = daysadd(Settle,360*[.25 .5 1 2 3 5 7 10 20],1);
ZeroRates = [.0089 .0096 .0107 .0130 .0166 .0248 .0306 .0356 .0454]';

Compute the RateSpec.

RateSpec = intenvset('StartDates', Settle, 'EndDates', CurveDates,...
'Rates', ZeroRates)
RateSpec = 

           FinObj: 'RateSpec'
      Compounding: 2
             Disc: [9x1 double]
            Rates: [9x1 double]
         EndTimes: [9x1 double]
       StartTimes: [9x1 double]
         EndDates: [9x1 double]
       StartDates: 731763
    ValuationDate: 731763
            Basis: 0
     EndMonthRule: 1

Compute the spread.

Price = 98;
CFAmounts = [30;40;30];
CFDates = datenum({'15-Jul-2004', '15-Jul-2005', '15-Jul-2006'});

Spread = cfspread(RateSpec, Price, CFAmounts, CFDates, Settle)
Spread =

   1.0e+03 *

   -8.7956
   -4.0774
   -3.7073

See Also

| |

Was this topic helpful?