spot_to_df_fcn: Create a discount factor function from a yield curve

Description Usage Arguments Value Examples

Description

Use a piecewise constant approximation to the given spot curve to generate a function capable of returning corresponding discount factors

Usage

1
spot_to_df_fcn(yield_curve)

Arguments

yield_curve

A data.frame with numeric columns time (in increasing order) and rate (in natural units)

Value

A function taking two time arguments, which returns the discount factor from the second to the first

Examples

1
2
3
4
disct_fcn = ragtop::spot_to_df_fcn(
  data.frame(time=c(1, 5, 10, 15),
             rate=c(0.01, 0.02, 0.03, 0.05)))
print(disct_fcn(1, 0.5))


Search within the ragtop package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.