spotratecurve()
S3 method createas a SpotRateCurve object.
It is dispatched for numeric values, that represent spot rates and
for SpotRate objects.
a numeric representing a spot rate value or a SpotRate object.
a numeric vector with positive values representing the days of the term structure.
additional arguments
the curve reference date.
a character with the compouning name.
a character representing the daycount.
a calendar object.
a SpotRate object that is used as reference to build the SpotRateCurve object.
A SpotRateCurve
object.
terms <- c(1, 11, 26, 27, 28)
rates <- c(0.0719, 0.056, 0.0674, 0.0687, 0.07)
curve <- spotratecurve(rates, terms, "discrete", "actual/365", "actual")
# access the term 11 days
curve[[11]]
#> SpotRateCurve
#> 11 days 0.056
#> discrete actual/365 actual
#> Reference date: 2023-06-27
# access the second element
curve[2]
#> SpotRateCurve
#> 11 days 0.056
#> discrete actual/365 actual
#> Reference date: 2023-06-27