bond_yields: Bond Yield Calculation

Description Usage Arguments Value See Also Examples

Description

Function for the calculation of bond yields.

Usage

1
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

The function returns a matrix with the yields of the bonds and the associated maturities.

See Also

uniroot

Examples

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)

changshun/termstrc documentation built on May 13, 2019, 3:24 p.m.