% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/chapter15_variable_interest.R
\name{pv_spot_cashflows}
\alias{pv_spot_cashflows}
\title{Present value of deterministic cash flows using spot rates}
\usage{
pv_spot_cashflows(
  amounts,
  times,
  spot,
  compounding = c("annual", "semiannual")
)
}
\arguments{
\item{amounts}{Numeric vector of cash-flow amounts.}

\item{times}{Numeric vector of payment times in years.}

\item{spot}{Numeric vector of spot rates matched elementwise to
\code{times}. The value corresponding to a time-zero cash flow is ignored.}

\item{compounding}{Character string equal to \code{"annual"} or
\code{"semiannual"}.}
}
\value{
A numeric scalar.
}
\description{
Discounts each cash flow using the spot rate matched to its payment time.
Time-zero cash flows are not discounted.
}
\examples{
pv_spot_cashflows(
  amounts = c(200000, 50000, 50000, 100000),
  times = c(0, 0.5, 1, 2),
  spot = c(0, 0.02440, 0.02601, 0.02936),
  compounding = "semiannual"
)

}
