Description Usage Arguments Value See Also Examples
Used in yield_cfs_single
to do the actual yield calc.
The equivalent of the ytm
function from the NMOF
manual is used to calculate the yield, with a 5% initial guess.
It assumes that the first
cashflow in the cf
vector is negative as it is an outflow equal
to the present value of the cashflows. The corresponding element
in the times
vector should be 0.
1 | calc_ytm(cf, times, y0 = 0.05, tol = 1e-05, maxit = 1000L)
|
cf |
Vector of cashflow amounts (first cashflow is an outflow) |
times |
Vector of yearfracs (times to cashflow, first should be 0) |
y0 |
Initial yield guess (5% default) |
tol |
Tolerance in the yield calculation |
maxit |
Maximum number of iterations |
Numeric value of the yield/IRR for the given cashflow amounts and yearfracs in decimal form (not percentage) (e.g. .05)
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_yield
, calc_yield.bond
,
calc_yield.default
;
discount_cfs_single
;
risk_cfs_single
;
yield_cfs_single
1 2 3 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.