Learn R Programming

termstrc (version 1.3.7)

bond_yields: Bond Yield Calculation

Description

Function for the calculation of bond yields.

Usage

bond_yields(cashflows, m, searchint = c(-1, 1), tol = 1e-10)

Arguments

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 uniroot.

Value

See Also

uniroot

Examples

Run this code
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)

Run the code above in your browser using DataLab