Help CenterHelp Center
ratecurve
Calculate discount factors for a ratecurve object
outDF = discountfactors(obj,inpDates)
example
outDF = discountfactors(obj,inpDates) calculates the discount factors for a ratecurve object.
outDF
obj
inpDates
collapse all
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.
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
ratecurve object, specified using a previously created ratecurve object.
Data Types: object
object
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.
NPOINTS
1
Data Types: string | datetime | double | char | cell
string
datetime
double
char
cell
Discount factors, returned as a numeric.
ratecurve | forwardrates | zerorates | irbootstrap
forwardrates
zerorates
irbootstrap
이 예제의 수정된 버전이 있습니다. 사용자가 편집한 내용을 반영하여 이 예제를 여시겠습니까?
다음 MATLAB 명령에 해당하는 링크를 클릭했습니다.
명령을 실행하려면 MATLAB 명령 창에 입력하십시오. 웹 브라우저는 MATLAB 명령을 지원하지 않습니다.
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:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office