Forward rate \(f_{n,k}\) from spot rates
fnk_from_z.RdComputes the \(n\)-year forward \(k\)-year annual effective rate implied by annual effective spot rates: $$ (1+z_{n+k})^{n+k} = (1+z_n)^n (1+f_{n,k})^k. $$
Details
The input vector z should contain annual effective spot rates for
maturities 1, 2, ..., length(z).
Examples
z <- c(0.03, 0.04, 0.05, 0.06, 0.07)
fnk_from_z(z, n = 1, k = 4)
#> [1] 0.0802404
fnk_from_z(z, n = 2, k = 2)
#> [1] 0.08038462