spot_rate: Derive Spot Rate from Discount Factor and Fractional Years

Description Usage Arguments Value Author(s) References Examples

View source: R/BondMath.R

Description

Given a discount factor Z(t, T) and T - t, return the spot rate

Usage

1
spot_rate(Z, years)

Arguments

Z

the discount factor (a decimal in (0, 1))

years

the fractional years to maturity

Value

the spot rate in decimal form

Author(s)

George Fisher

References

See the vignette "veronesi-ch02" Example 2.11

Examples

1
2
3
4
5
6
7
8
9
library(ustreasuries)
Z <- c(0.989590, 0.981892, 0.973147, 0.962441, 0.950822, 0.937612, 0.922213,
       0.906046, 0.887259, 0.869809, 0.850858, 0.831241, 0.811114, 0.790613,
       0.768759, 0.748256, 0.726763, 0.708392, 0.691582, 0.681581)

 years <- c(0.5,  1.0,  1.5,  2.0,  2.5,  3.0,  3.5,  4.0,  4.5,  5.0,  5.5,
            6.0,  6.5,  7.0,  7.5,  8.0,  8.5,  9.0,  9.5, 10.0)

 spot_rate(Z, years)

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