solveYield: Computing bond yields

View source: R/solveYield.R

solveYieldR Documentation

Computing bond yields

Description

This function computes the yield to maturity, given the (flat) bond price.

Usage

solveYield(buyDate, matDate, rateCoupon, bondPr, nPay)

Arguments

buyDate

settlement date (the date when the bond is bought)

matDate

maturity date

rateCoupon

annual coupon rate

bondPr

bond price. The flat price without accrued interest.

nPay

number of payments per year

Details

all the rates are given in decimals

Value

A list with the following components:

yieldToMaturity

yield to maturity

flatPrice

flat price

daysSinceLastCoupon

days since previous coupon payment

daysInCouponPeriod

days in a coupon period

accruedInterest

accrued interest since last coupon payment

invoicePrice

invoice price (= flat price + accrued interest)

Note

With Excel function YIELD you can do the same.

Author(s)

Arto Luoma <arto.luoma@wippies.com>

References

Bodie, Kane, and Marcus (2014) Investments, 10th Global Edition, McGraw-Hill Education, (see Bond Pricing between Coupon Dates in Section 14.2).

See Also

bondPrice

Examples

solveYield("2012-7-31","2018-7-31",0.0225,100,2)

RcmdrPlugin.RiskDemo documentation built on Nov. 13, 2023, 5:07 p.m.