% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/chapter15_variable_interest.R
\name{fnk_from_z}
\alias{fnk_from_z}
\title{Forward rate implied by spot rates}
\usage{
fnk_from_z(z, n, k)
}
\arguments{
\item{z}{Numeric vector of annual effective spot rates for maturities
\code{1, ..., length(z)}. Each value must be greater than \code{-1}.}

\item{n}{Nonnegative integer forward-start time.}

\item{k}{Positive integer forward period.}
}
\value{
A numeric scalar.
}
\description{
Computes the annual effective forward rate for the interval from time
\code{n} to time \code{n + k}:
\deqn{
(1+z_{n+k})^{n+k}
=
(1+z_n)^n(1+f_{n,k})^k.
}
}
\examples{
z <- c(0.03, 0.04, 0.05, 0.06, 0.07)
fnk_from_z(z, n = 1, k = 4)
fnk_from_z(z, n = 2, k = 2)

}
