Description Usage Arguments Value Author(s) References Examples
Given a discount factor Z(t, T) and T - t, return the spot rate
1 | spot_rate(Z, years)
|
Z |
the discount factor (a decimal in (0, 1)) |
years |
the fractional years to maturity |
the spot rate in decimal form
George Fisher
See the vignette "veronesi-ch02" Example 2.11
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.