Computes implied rates to compounding factors.
implied_rate(x, t, val, ...)
a Compounding object or a character with the compounding name.
a numeric representing the term.
a numeric representing the compounding factor.
additional arguments. Currently unused.
A numeric value that represents a spot rate.
If the x
argument is a character
with a valid compounding name
(simple
, discrete
, continuous
) the function
instanciates a Compounding object and then computes the implied rate
for the given compounding values and terms.
implied_rate("simple", 2, 1.1)
#> [1] 0.05
implied_rate("discrete", 2, 1.1025)
#> [1] 0.05
implied_rate("continuous", 2, 1.105170918)
#> [1] 0.05
comp <- compounding("discrete")
compound(comp, 0.06, 2) # equals (1 + 0.06) ^ 2 = 1.1236
#> [1] 1.068138
implied_rate(comp, 1.1236, 2) # equals 0.06
#> [1] 0.8531716