YTM: Yield To Maturity

Description Usage Arguments Value Author(s) Examples

View source: R/BondMath.R

Description

"Lazy-Man's" YTM: no dates, just fractional years

Usage

1
YTM(price, coupon, years)

Arguments

price

the actual price paid

coupon

the annual coupon rate

years

Fractional years: 2 years, 3 months, 10 days = 2 + 3/12 + 10/365 = 2.277397

Value

the YTM

Author(s)

George Fisher

Examples

1
2
3
4
5
6
7
# Veronesi example 2.11
library(ustreasuries)

ytm <- YTM(107.8906, 0.0475, 9.5)
print(paste0(ytm, " = ", round(ytm*100,4),"%"))
ytm <- YTM(141.5267, 0.08875, 9.5)
print(paste0(ytm, " = ", round(ytm*100,4),"%"))

grfiv/ustreasuries documentation built on May 17, 2019, 8:36 a.m.