Skip to contents

Written, earned, unearned and in-force amounts of a table of policies, by window and label. Each policy earns its amount (an exposure count, or a premium) evenly over its term, from its effective date up to, and not including, its expiration date.

Usage

earned_exposure(
  effective,
  expiration,
  amount,
  windows,
  kind = "calendar",
  method = "daily",
  valuation = NULL,
  label = NULL,
  changes = NULL,
  cancellation = NULL
)

in_force_amount(
  effective,
  expiration,
  amount,
  at,
  changes = NULL,
  cancellation = NULL
)

calendar_windows(first_year, last_year, by = "year")

Arguments

effective, expiration

The policies' effective and expiration dates: Dates, or character strings "YYYY-MM-DD". The expiration is the first day the policy is not in force.

amount

The full-term amount of each policy.

windows

The dates the windows lie between, increasing; see calendar_windows().

kind

"calendar" or "policy".

method

"daily" (exact days), "half_month" (the half-month grid of the ratemaking exhibits) or "twenty_fourths" (the "15th of the month" rule: every policy date at mid-month).

valuation

See the table as of this date; NULL for no cut-off.

label

A label a policy; the table has a set of rows for each.

changes

Mid-term changes: a data frame with columns policy (the position of the policy, from 1), date and amount (the full-term amount from that date); NULL for none.

cancellation

A cancellation date a policy, the first day not in force, NA for a policy not cancelled; NULL for none.

at

Dates at which to take the in-force amount.

first_year, last_year

The first and last calendar year.

by

"year", "quarter" or "month".

Value

earned_exposure(): a data frame with columns label, from, to (Dates), written, earned, unearned and in_force, one row a label and window. in_force_amount(): a numeric vector, one value a date. calendar_windows(): a Date vector, one more than there are windows.

Details

With kind = "calendar" a window holds what was written and earned in it, and the unearned and in-force amounts at its end. With kind = "policy" a window holds the policies written in it, with all they earn; give valuation to see them as of a date.

"At a window's end" and "as of a valuation date" mean the close of the day before: a policy that expires on that date is still in force, and one effective on it is not yet written.

A mid-term change gives the policy a new full-term amount from a date; it is written on that date, as the difference in full-term amounts for the term still to run. A cancellation is written back on the last day in force. So a calendar period's written amount can be negative, while a policy period holds everything its policies wrote, net.

in_force_amount() is the amount in force on each of some dates: the full-term amounts, as they stand that day, of the policies effective on or before it and not yet expired or cancelled.

calendar_windows() gives the dates between calendar years, quarters or months.

Examples

# Werner and Modlin's six annual policies, a quarter apart.
effective <- as.Date(c("2010-10-01", "2011-01-01", "2011-04-01",
                       "2011-07-01", "2011-10-01", "2012-01-01"))
expiration <- seq(effective[1], by = "quarter", length.out = 10)[5:10]
years <- calendar_windows(2010, 2012)
earned_exposure(effective, expiration, rep(1, 6), years, method = "half_month")
#>   label       from         to written earned unearned in_force
#> 1       2010-01-01 2011-01-01       1   0.25     0.75        1
#> 2       2011-01-01 2012-01-01       4   3.25     1.50        4
#> 3       2012-01-01 2013-01-01       1   2.50     0.00        1

# The fourth policy cancelled after nine months.
earned_exposure(effective, expiration, rep(1, 6), years, method = "half_month",
                cancellation = c(NA, NA, NA, "2012-04-01", NA, NA))$written
#> [1] 1.00 4.00 0.75

in_force_amount(effective, expiration, rep(1, 6), c("2011-01-01", "2011-06-15"))
#> [1] 2 3