Skip to contents

Adds the benefit side of a single-life or two-life insurance contract to an existing [life_contract()] object. This function stores the specification only; it does not calculate an actuarial present value.

Usage

add_insurance(
  contract,
  type = c("whole", "term", "endowment", "pure_endowment", "variable_k"),
  benefit = 1,
  n = Inf,
  h = 0L,
  k = 1L,
  frac = c("UDD", "CF", "CML", "Balducci")
)

Arguments

contract

A `tidyact_life_contract` object.

type

Insurance type. Single-life contracts support `"whole"`, `"term"`, `"endowment"`, and `"variable_k"`. Two-life contracts support `"whole"`, `"term"`, `"endowment"`, and `"pure_endowment"`.

benefit

Benefit amount. For standard products, a single nonnegative numeric value. For single-life `type = "variable_k"`, a numeric vector or a function of time may be supplied.

n

Insurance term in years. Use `Inf` for whole-life insurance.

h

Nonnegative integer deferment period in years.

k

Positive integer. Benefit frequency for single-life `type = "variable_k"`.

frac

Fractional-age assumption: `"UDD"`, `"CF"`, `"CML"`, or `"Balducci"`.

Value

The original contract with an `insurance` component.

Details

For two-life contracts, the insurance status is inferred from `contract$lives`: `"joint"` becomes joint-life status and `"last_survivor"` becomes last-survivor status.

Components may be added in either order and unrelated contract fields are retained. Standard finite terms must round to at least one year. Large integer-valued terms, deferments and frequencies are stored as doubles when outside R's integer range; feasibility of a valuation horizon is checked by the consumer. Variable-benefit functions are stored without being evaluated.