Description Usage Arguments Value See Also Examples
Given a bond
or the necessary parameters to construct one, this
will calculate the DV01 and other risks of the bond
for the worst
workout date. The workout dates used are the based on the cfs
object's last cashflow dates in the bond
. This function uses
discount_cfs_single
to do the actual calculations.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | calc_risk(x, ...)
## Default S3 method:
calc_risk(maturity, settle, coupon, price_yield,
input_type = "Y", returnCFs = FALSE, conv = "30/360", freq = 2)
## S3 method for class 'bond'
calc_risk(b, settle, price_yield, input_type = "Y",
returnCFs = FALSE)
calc_dv01(x, ...)
## Default S3 method:
calc_dv01(maturity, settle, coupon, price_yield,
input_type = "Y", conv = "30/360", freq = 2)
## S3 method for class 'bond'
calc_dv01(b, settle, price_yield, input_type = "Y")
|
maturity |
Maturity/Workout date |
settle |
Settlement Date |
coupon |
Annnual coupon amount |
price_yield |
The clean price of the bond or the yield to worst |
input_type |
|
returnCFs |
Boolean flag indicating whether or not to return the calculated set of cashflows and risk metrics |
conv |
Daycount convention (one of |
freq |
Coupon frequency (number of periods per year) |
b |
A |
Numeric value of the DV01 and other risks and corresponding worst
workout date and workout type if there are multiple sets of cashflows
in the bond or a full set of calculated cashflows and risk metrics
as a tbl_df
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_yield
, calc_yield.bond
,
calc_yield.default
; calc_ytm
;
discount_cfs_single
;
risk_cfs_single
;
yield_cfs_single
1 2 3 4 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.