% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/chapter15_variable_interest.R
\name{chapter15_spot_interest_apv}
\alias{chapter15_spot_interest_apv}
\alias{nEx_spot}
\alias{Axn1_spot}
\alias{Axn_spot}
\alias{axn_spot}
\title{Spot-rate actuarial present value functions}
\usage{
nEx_spot(qx, z, benefit = 1)

Axn1_spot(qx, z, benefit = 1)

Axn_spot(qx, z, benefit = 1)

axn_spot(qx, z, type = c("immediate", "due"), benefit = 1)
}
\arguments{
\item{qx}{Numeric vector of one-year mortality rates.}

\item{z}{Numeric vector of annual effective spot rates for maturities
\eqn{1,\dots,n}.}

\item{benefit}{Amount of each annuity payment.}

\item{type}{Either \code{"immediate"} or \code{"due"}.}
}
\value{
A numeric scalar.

A numeric scalar.

A numeric scalar.

A numeric scalar.
}
\description{
Chapter 15 functions for actuarial present values when discounting uses
spot rates by maturity. If \eqn{z_t} denotes the annual effective spot rate
for maturity \eqn{t}, then the discount factor is \eqn{(1+z_t)^{-t}}.

Computes
\deqn{
{}_nE_x = (1+z_n)^{-n}\cdot {}_np_x.
}

Computes
\deqn{
A_{x:\overline{n}|}^1 = \sum_{t=1}^{n}(1+z_t)^{-t}\cdot {}_{t-1}p_x \cdot q_{x+t-1}.
}

Computes
\deqn{
A_{x:\overline{n}|} = A_{x:\overline{n}|}^1 + {}_nE_x
}
using spot-rate discount factors.

For an immediate annuity,
\deqn{
a_{x:\overline{n}|} = \sum_{t=1}^{n}(1+z_t)^{-t}\cdot {}_tp_x.
}
}
\details{
For an annuity-due,
\deqn{
\ddot{a}_{x:\overline{n}|} = \sum_{t=0}^{n-1}(1+z_t)^{-t}\cdot {}_tp_x,
}
where the time-0 discount factor is 1.
}
\examples{
qx <- c(.02, .03, .04, .05, .06)
z  <- c(.03, .04, .05, .06, .07)
nEx_spot(qx, z, benefit = 1000000)

qx <- c(.02, .03, .04, .05, .06)
z  <- c(.03, .04, .05, .06, .07)
Axn1_spot(qx, z)

qx <- c(.02, .03, .04, .05, .06)
z  <- c(.03, .04, .05, .06, .07)
Axn_spot(qx, z)

qx <- c(.02, .03, .04, .05, .06)
z  <- c(.03, .04, .05, .06, .07)
axn_spot(qx, z, type = "due")

}
