% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/chapter14_multiple_decrement.R
\name{gain_loss_md}
\alias{gain_loss_md}
\title{Gain or loss in a multiple-decrement model}
\usage{
gain_loss_md(
  Vt,
  G,
  r,
  e,
  i,
  b1,
  b2,
  s1 = 0,
  s2 = 0,
  q1,
  q2,
  Vt1,
  year_end_cause2 = FALSE,
  q1prime = NULL,
  q2prime = NULL
)
}
\arguments{
\item{Vt}{Gross premium reserve at time \eqn{t}.}

\item{G}{Gross premium for the year.}

\item{r}{Percent-of-premium expense factor.}

\item{e}{Fixed expense at the beginning of the year.}

\item{i}{Earned interest rate.}

\item{b1}{Cause 1 benefit.}

\item{b2}{Cause 2 benefit.}

\item{s1}{Claim settlement expense for Cause 1.}

\item{s2}{Claim settlement expense for Cause 2.}

\item{q1}{Cause 1 decrement probability.}

\item{q2}{Cause 2 decrement probability.}

\item{Vt1}{Gross premium reserve at time \eqn{t+1}.}

\item{year_end_cause2}{Logical; if \code{TRUE}, use the year-end Cause 2 form.}

\item{q1prime}{Single-decrement Cause 1 probability for the year-end Cause 2 case.}

\item{q2prime}{Single-decrement Cause 2 probability for the year-end Cause 2 case.}
}
\value{
A numeric scalar.
}
\description{
Computes the gain or loss expression from Section 14.6.
}
\details{
With within-year decrement probabilities, the function evaluates
\deqn{
[{}_{t}V^G + G(1-r) - e](1+i)
- \left[(b^{(1)}+s^{(1)})q^{(1)} + (b^{(2)}+s^{(2)})q^{(2)}
+ p^{(\tau)} {}_{t+1}V^G \right]
}

If \code{year_end_cause2 = TRUE}, the Cause 2 decrement is treated as
occurring only at year end, matching Equation (14.30).
}
\examples{
gain_loss_md(
  Vt = 115.00, G = 16, r = 0, e = 3, i = 0.06,
  b1 = 1000, b2 = 110, s1 = 0, s2 = 0,
  q1 = 0.01, q2 = 0.10, Vt1 = 128.83
)

}
