Description Usage Arguments Value See Also Examples
Function for the calculation of bond yields.
1 | bond_yields(cashflows, m, searchint = c(-1, 1), tol = 1e-10)
|
cashflows |
matrix with the cashflows of the bonds, including the current dirty price. |
m |
maturity matrix of the bonds |
searchint |
search interval for root finding. |
tol |
desired accuracy for function |
The function returns a matrix with the yields of the bonds and the associated maturities.
1 2 3 4 | data(govbonds)
cf_p <- create_cashflows_matrix(govbonds[[1]],include_price=TRUE)
m_p <- create_maturities_matrix(govbonds[[1]],include_price=TRUE)
bond_yields(cf_p,m_p)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.