Discount factors from interest rates
collapse all in page
Syntax
Disc = rate2disc(Compounding,Rates,EndTimes,StartTimes)
[Disc,EndTimes,StartTimes] = rate2disc(Compounding,Rates,EndTimes,StartTimes,ValuationDate,Basis,EndMonthRule)
Description
example
Disc = rate2disc(Compounding,Rates,EndTimes,StartTimes)
computes discount factors from interest rates where interval points are input as times in periodic units.
The rate2disc
function computes the discounts over a series of NPOINTS
time intervals given the annualized yield over those intervals. NCURVES
different rate curves can be translated at once if they have the same time structure. The time intervals can represent a zero curve or a forward curve.
The output Disc
is an NPOINTS
-by-NCURVES
column vector of discount factors in decimal form representing the value at time StartTimes
of a unit cash flow received at time EndTimes
.
example
[Disc,EndTimes,StartTimes] = rate2disc(Compounding,Rates,EndTimes,StartTimes,ValuationDate,Basis,EndMonthRule)
computes discount factors from interest rates where ValuationDate
is passed and interval points are input as dates.
You can specify the investment intervals either with input times or with input dates. Entering ValuationDate
invokes the date interpretation; omitting ValuationDate
invokes the default time interpretations.
Examples
collapse all
Compute Discount Factors From Interest Rates
Open Live Script
This example shows the two uses of rate2disc
.
Interval Points Are Input as Times in Periodic Units
Compute discounts from a zero curve at 6 months, 12 months, and 24 months. The times to the cash flows are 1
, 2
, and 4
. Use rate2disc
to compute the present value (at time 0) of the cash flows.
Compounding = 2;Rates = [0.05; 0.06; 0.065];EndTimes = [1; 2; 4];Disc = rate2disc(Compounding, Rates, EndTimes)
Disc = 3×1 0.9756 0.9426 0.8799
Interval Points Are Input as Dates
Compute discounts from a zero curve at 6 months, 12 months, and 24 months. Use dates to specify the ending time horizon.
Compounding = 2;Rates = [0.05; 0.06; 0.065];EndDates = ['10/15/97'; '04/15/98'; '04/15/99'];ValuationDate = '4/15/97'; Disc = rate2disc(Compounding, Rates, EndDates, [], ValuationDate)
Disc = 3×1 0.9756 0.9426 0.8799
Input Arguments
collapse all
Compounding
— Compounding rate
integer with value of 0
, 1
, 2
, 3
, 4
, 6
, 12
, 365
, -1
Compounding rate for which the input zero rates are compounded when annualized, specified as one of the following scalar integers. Compounding determines the formula for the discount factors (Disc):
If
Compounding
=0
for simple interest:Disc = 1/(1 + Z * T)
, whereT
is time in years and simple interest assumes annual timesF = 1
.
If
Compounding
=1
,2
,3
,4
,6
,12
:Disc = (1 + Z/F)^(-T)
, whereF
is the compounding frequency,Z
is the zero rate, andT
is the time in periodic units, for example,T = F
is one year.
If
Compounding
=365
:Disc = (1 + Z/F)^(-T)
, whereF
is the number of days in the basis year andT
is a number of days elapsed computed by basis.
If
Compounding
=-1
:Disc = exp(-T*Z)
, whereT
is time in years.
Data Types: double
Rates
— Rates
decimal
Rates, specified as a number of points (NPOINTS
) by number of curves (NCURVES
) matrix of rates in decimal form. Rates
are the yields over investment intervals from StartTimes, when the cash flow is valued, to EndTimes, when the cash flow is received. For example, 5% is 0.05
in Rates
.
Data Types: double
EndTimes
— End times
serial date number | date character vector | numeric
End times, specified as a scalar or an NPOINTS
-by-1
column vector using serial date numbers or date character vectors, or with times in periodic units ending the interval to discount over. When EndTimes
is not a date, the value for EndTimes
is T
computed from SIA semi-annual time factors, Tsemi
, by the formula T = Tsemi/2 * F
, where F
is the compounding frequency. F
is set to 1
for continuous compounding.
Note
When ValuationDate is not passed, EndTimes
is interpreted as times. If Compounding = 365
(daily), EndTimes
is measured in days.
Data Types: double
| char
StartTimes
— Start times
serial date number | date character vector | numeric
Start times, specified a scalar or an NPOINTS
-by-1
column vector using serial date numbers or date character vectors, or with times in periodic units starting the interval to discount over. StartDates
must be earlier than EndDates
. When StarTimes
is not a date, the value for StartTimes
is T
computed from SIA semi-annual time factors, Tsemi
, by the formula T = Tsemi/2 * F
, where F
is the compounding frequency. F
is set to 1
for continuous compounding.
Note
When ValuationDate is not passed, StartTimes
is interpreted as times. If Compounding = 365
(daily), StartTimes
is measured in days.
Data Types: double
| char
ValuationDate
— Observation date of the investment horizons entered in StartTimes
and EndTimes
serial date number | date character vector
Observation date of the investment horizons entered in StartTimes
and EndTimes
, specified as scalar serial date number or date character vector.
Note
You can specify the investment intervals either with input times or with input dates. Entering ValuationDate
invokes the date interpretation; omitting ValuationDate
invokes the default time interpretations.
Data Types: double
| char
Basis
— Day-count basis
0
(actual/actual) (default) | integer from 0
to 13
Day-count basis of the instrument when using dates for StartTimes and EndTimes, specified as a scalar or an NINST
-by-1
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
EndMonthRule
— End-of-month rule flag
1
(in effect) (default) | nonnegative integer with values 0
or 1
End-of-month rule flag when using dates for StartTimes and EndTimes, specified as a scalar or an NINST
-by-1
vector of nonnegative integers. This rule applies only when Maturity
is an end-of-month date for a month having 30 or fewer days.
0
= Ignore rule, meaning that a bond coupon payment date is always the same numerical day of the month.1
= Set rule on, meaning that a bond coupon payment date is always the last actual day of the month.
Data Types: double
Output Arguments
collapse all
Disc
— Discount factors
vector
Discount factors, returned as an NPOINTS
-by-NCURVES
column vector of in decimal form representing the value at time StartTimes of a unit cash flow received at time EndTimes.
EndTimes
— Times ending the interval to discount over
vector
Times ending the interval to discount over, returned as an NPOINTS
-by-1
column vector, measured in periodic units.
StartTimes
— Times starting the interval to discount over
vector
Times starting the interval to discount over, returned as an NPOINTS
-by-1
column vector, measured in periodic units.
Version History
Introduced before R2006a
See Also
disc2rate | ratetimes
Topics
- Modeling the Interest-Rate Term Structure
- Interest-Rate Term Conversions
- Interest Rates Versus Discount Factors
- Understanding the Interest-Rate Term Structure
Open Example
You have a modified version of this example. Do you want to open this example with your edits?
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:
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
- Deutsch
- English
- Français
- United Kingdom (English)
Contact your local office