Average written and earned dates of a period
average_written_date.RdTrend lengths run between these dates (Werner and Modlin, ch. 5 and 6).
A "calendar" period is premium earned, or losses occurring, in
[start, end); a "policy" period is the policies written in it, over
their whole term. The forecast period is the policy period of the
policies written while new rates are in effect. Premium is trended
between average written dates, losses between average earned (accident)
dates.
Examples
# Calendar year 2011 premium to rates effective 1/1/13: 2.5 years.
average_written_date(2013, 2014, 1, "policy") - average_written_date(2011, 2012, 1)
#> [1] 2.5
# Accident year 2011 to rates effective 1/1/15, six-month policies: 4.25.
average_earned_date(2015, 2016, 0.5, "policy") - average_earned_date(2011, 2012, 0.5)
#> [1] 4.25