% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/chapter17_profit_analysis.R
\name{Pr_vector_disc}
\alias{Pr_vector_disc}
\title{Profit vector for a discrete profit-analysis model}
\usage{
Pr_vector_disc(
  V,
  G,
  i,
  r = 0,
  e = 0,
  q1,
  q2 = 0,
  b1,
  b2 = 0,
  s1 = 0,
  s2 = 0,
  p_tau = NULL,
  pre_contract_expense = 0
)
}
\arguments{
\item{V}{Numeric vector of gross premium reserves with length
\code{n + 1}, including the issue-time and terminal reserves.}

\item{G}{Gross premium by policy year.}

\item{i}{Annual effective interest rate by policy year. Values must be
greater than \code{-1}.}

\item{r}{Percent-of-premium expense rate by policy year. Values must lie in
\code{[0, 1]}.}

\item{e}{Fixed expense by policy year.}

\item{q1}{Probability of the first decrement by policy year.}

\item{q2}{Probability of the second decrement by policy year.}

\item{b1}{Benefit payable on the first decrement.}

\item{b2}{Benefit payable on the second decrement.}

\item{s1}{Settlement expense associated with the first decrement.}

\item{s2}{Settlement expense associated with the second decrement.}

\item{p_tau}{Optional in-force probability by policy year. If omitted, it is
calculated as \code{1 - q1 - q2}.}

\item{pre_contract_expense}{Nonnegative scalar pre-contract expense.}
}
\value{
A named numeric vector of length \code{n + 1}.
}
\description{
Computes expected profit by policy year for a discrete contract with up to
two decrements. The first element is the negative pre-contract expense.
}
\details{
For policy year \eqn{k}, the expected profit is
\deqn{
[V_{k-1} + G_k(1-r_k)-e_k](1+i_k)
-
[(b_k^{(1)}+s_k^{(1)})q_k^{(1)}
+(b_k^{(2)}+s_k^{(2)})q_k^{(2)}
+V_kp_k^{(\tau)}].
}

Scalar yearly inputs are recycled to the number of policy years determined
by \code{length(V) - 1}.
}
\examples{
V <- c(0, 5.66, 6.17, 0)
qx <- c(0.00142, 0.00153, 0.00166)
Pr_vector_disc(
  V = V, G = 95, i = 0.06, r = 0.05, e = 10,
  q1 = qx, b1 = 50000, pre_contract_expense = 15
)

}
