discountfactors
Calculate discount factors for a ratecurve
object
Description
Examples
Calculate Discount Factors for a ratecurve
Object
Create a ratecurve
object using ratecurve
.
Settle = datetime(2019,9,15); Type = 'zero'; ZeroTimes = [calmonths(6) calyears([1 2 3 4 5 7 10 20 30])]'; ZeroRates = [0.0052 0.0055 0.0061 0.0073 0.0094 0.0119 0.0168 0.0222 0.0293 0.0307]'; ZeroDates = Settle + ZeroTimes; myRC = ratecurve('zero',Settle,ZeroDates,ZeroRates,'Compounding',2,'Basis',5,'InterpMethod',"pchip",'ShortExtrapMethod',"linear",'LongExtrapMethod',"pchip")
myRC = ratecurve with properties: Type: "zero" Compounding: 2 Basis: 5 Dates: [10x1 datetime] Rates: [10x1 double] Settle: 15-Sep-2019 InterpMethod: "pchip" ShortExtrapMethod: "linear" LongExtrapMethod: "pchip"
Compute the discount factors using discountfactors
.
CurveSettle = datetime(2019,9,15); outRates = discountfactors(myRC,CurveSettle+30:30:CurveSettle+720)
outRates = 1×24
0.9996 0.9992 0.9988 0.9983 0.9979 0.9974 0.9970 0.9965 0.9961 0.9956 0.9951 0.9946 0.9941 0.9936 0.9931 0.9926 0.9921 0.9915 0.9910 0.9904 0.9899 0.9893 0.9887 0.9881
Input Arguments
obj
— ratecurve
object
ratecurve
object
ratecurve
object, specified using a previously created ratecurve
object.
Data Types: object
inpDates
— Input dates
datetime | serial date number | date character vector | date string
Input dates, specified as a scalar or an
NPOINTS
-by-1
vector of datetimes, serial date
numbers, cell array of date character vectors, or string array.
Data Types: string
| datetime
| double
| char
| cell
Output Arguments
outDF
— Discount factors
numeric
Discount factors, returned as a numeric.
Version History
Beispiel öffnen
Sie haben eine geänderte Version dieses Beispiels. Möchten Sie dieses Beispiel mit Ihren Änderungen öffnen?
MATLAB-Befehl
Sie haben auf einen Link geklickt, der diesem MATLAB-Befehl entspricht:
Führen Sie den Befehl durch Eingabe in das MATLAB-Befehlsfenster aus. Webbrowser unterstützen keine MATLAB-Befehle.
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)