A ForwardRate object can be created from a SpotRate object and a SpotRateCurve.

as.forwardrate(x, ...)

# S3 method for class 'SpotRate'
as.forwardrate(x, terms, refdate = NULL, ...)

# S3 method for class 'SpotRateCurve'
as.forwardrate(x, t1 = NULL, t2 = NULL, ...)

Arguments

x

a SpotRate or a SpotRateCurve object.

...

additional arguments

terms

a numeric with positive values representing terms or a Term object.

refdate

the curve reference date.

t1

initial term

t2

final term

Value

A ForwardRate object created from another object, SpotRate or SpotRateCurve.

Examples

spr <- spotrate(c(0.1, 0.11, 0.12), "discrete", "business/252", "Brazil/ANBIMA")
as.forwardrate(spr, term(c(21, 21, 21), "days"))
#>         ForwardRate
#> 21 days        0.10
#> 21 days        0.11
#> 21 days        0.12
#> discrete business/252 Brazil/ANBIMA

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",
  refdate = as.Date("2022-02-23")
)
as.forwardrate(curve)
#>         ForwardRate
#> 1 day    0.07190000
#> 10 days  0.05442303
#> 15 days  0.07583814
#> 1 day    0.10306142
#> 1 day    0.10570410
#> discrete actual/365 actual