ratecurve
Calculate zero rates for ratecurve object
outRates = zerorates(obj,inpDates)
outRates = zerorates(___,inpComp,inpBasis)
example
outRates = zerorates(obj,inpDates) computes zero rates for the ratecurve object (obj) based on inpDates.
outRates
obj
inpDates
outRates = zerorates(___,inpComp,inpBasis) optionally specifies the input compounding frequency (inpComp) and the input day-count basis (inpBasis) in addition to any of the input argument combinations in the previous syntax.
inpComp
inpBasis
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 zero rates using zerorates.
zerorates
CurveSettle = datetime(2019,9,15); outRates = zerorates(myRC,CurveSettle+30:30:CurveSettle+720)
outRates = 1×24 0.0049 0.0050 0.0050 0.0051 0.0051 0.0052 0.0052 0.0053 0.0053 0.0054 0.0054 0.0055 0.0055 0.0056 0.0056 0.0057 0.0057 0.0058 0.0058 0.0059 0.0059 0.0060 0.0060 0.0061
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
Compounding
–1
0
2
3
4
6
12
(Optional) Input compounding frequency, specified as a scalar numeric using one of the supported values: –1, 0, 1, 2, 3, 4, 6, or 12.
Data Types: double
13
(Optional) Input day-count basis, specified as a scalar integer.
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.
Zero rates, returned as a numeric.
discountfactors | forwardrates | irbootstrap | ratecurve
discountfactors
forwardrates
irbootstrap
You have a modified version of this example. Do you want to open this example with your edits?