getParYields
Get par yields for input dates for IRDataCurve
Description
computes par yields for input dates for an F = getParYields(CurveObj,InpDates)IRDataCurve object.
adds optional name-value pair arguments. F = getParYields(___,Name,Value)
Examples
This example shows how to get par yields for input dates for an IRDataCurve.
CurveSettle = datetime(2016,3,2);
Data = [2.09 2.47 2.71 3.12 3.43 3.85 4.57 4.58]/100;
Dates = datemnth(CurveSettle,12*[1 2 3 5 7 10 20 30]);
irdc = IRDataCurve('Zero',CurveSettle,Dates,Data);
getParYields(irdc, CurveSettle+30:30:CurveSettle+720)ans = 24×1
0.0175
0.0177
0.0181
0.0183
0.0186
0.0189
0.0194
0.0197
0.0200
0.0203
0.0206
0.0209
0.0212
0.0215
0.0218
⋮
This example shows how set the compounding of an IRDataCurve to Zero (simple interest) and then compute par yields from that curve.
CurveSettle = datetime(2016,3,2); Data = [2.09 2.47 2.71 3.12 3.43 3.85 4.57 4.58]/100; Dates = datemnth(CurveSettle,12*[1 2 3 5 7 10 20 30]); irdc = IRDataCurve('Zero',CurveSettle,Dates,Data,'Compounding',0); SimpleInt = irdc.getParYields(Dates(1), 'Basis', 2, 'Compounding', 1)
SimpleInt = 0.0209
Input Arguments
Interest-rate curve object, specified by using IRDataCurve.
Data Types: object
Input dates, specified as an
NINST-by-1 vector using a datetime
array, string array, or date character vectors. The input dates must be
after the Settle date of IRDataCurve.
To support existing code, getParYields also
accepts serial date numbers as inputs, but they are not recommended.
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN, where Name is
the argument name and Value is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Before R2021a, use commas to separate each name and value, and enclose
Name in quotes.
Example: F = getParYields(irdc,
CurveSettle+30:30:CurveSettle+720)
Compounding frequency per-year for par yield rates, specified as the
comma-separated pair consisting of 'Compounding' and
a scalar numeric using one of the supported values:
−1= Continuous compounding0= Simple interest (no compounding)1= Annual compounding2= Semiannual compounding3= Compounding three times per year4= Quarterly compounding6= Bimonthly compounding12= Monthly compounding
Data Types: double
Day count basis for the par yield rates, specified as the
comma-separated pair consisting of 'Basis' and 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.
Data Types: double
Output Arguments
Par yields, returned as a vector.
More About
Par yields refer to the interest rate (or coupon rate) at which a bond or fixed-income security is issued at its par value (face value).
The par yield is the coupon rate that makes the present value of a bond's future cash flows equal to its par value.
Version History
Introduced in R2008bAlthough getParYields supports serial date numbers,
datetime values are recommended instead. The
datetime data type provides flexible date and time
formats, storage out to nanosecond precision, and properties to account for time
zones and daylight saving time.
To convert serial date numbers or text to datetime values, use the datetime function. For example:
t = datetime(738427.656845093,"ConvertFrom","datenum"); y = year(t)
y =
2021
There are no plans to remove support for serial date number inputs.
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.
Seleziona un sito web
Seleziona un sito web per visualizzare contenuto tradotto dove disponibile e vedere eventi e offerte locali. In base alla tua area geografica, ti consigliamo di selezionare: .
Puoi anche selezionare un sito web dal seguente elenco:
Come ottenere le migliori prestazioni del sito
Per ottenere le migliori prestazioni del sito, seleziona il sito cinese (in cinese o in inglese). I siti MathWorks per gli altri paesi non sono ottimizzati per essere visitati dalla tua area geografica.
Americhe
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- 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)