Description Usage Arguments Value See Also Examples
Given a bond or the necessary parameters to construct one, this
will calculate the yield to worst of the bond. The workout dates
used are the based on the cfs object's last cashflow dates in
the bond. This function uses yield_cfs_single, which in
turn uses the calc_ytm to do the actual
calculations.
1 2 3 4 5 6 7 8 | calc_yield(x, ...)
## Default S3 method:
calc_yield(maturity, settle, coupon, clean_px,
conv = "30/360", freq = 2)
## S3 method for class 'bond'
calc_yield(b, settle, clean_px)
|
maturity |
Maturity/Workout date |
settle |
Settlement Date |
coupon |
Annnual coupon amount |
clean_px |
The clean price of the bond |
conv |
Daycount convention (one of |
freq |
Coupon frequency (number of periods per year) |
b |
A |
Numeric value of the yield to worst and corresponding worst workout date if there are multiple sets of cashflows in the bond
Other pricing functions: acc_int;
calc_clean_px,
calc_clean_px.bond,
calc_clean_px.default;
calc_dirty_px,
calc_dirty_px.bond,
calc_dirty_px.default;
calc_dv01, calc_dv01.bond,
calc_dv01.default, calc_risk,
calc_risk.bond,
calc_risk.default; calc_ytm;
discount_cfs_single;
risk_cfs_single;
yield_cfs_single
1 2 3 | calc_yield("2045-02-15", "2015-02-15", 4, 101, "Act/Act", 2)
b <- bond("2045-02-15", 2.5, "2015-02-17", "Act/Act", 2, 100, id = "ABCD")
calc_yield(b, "2015-05-15", 101)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.