Imaginator begins by simulating policies. These in turn will generate claims and those claims will produce loss transactions. This vignette will address the first step of the process: policy simulation. A block of policies may be generated simply as:
library(imaginator) set.seed(1234) <- policies_simulate( tbl_policy n = 10, num_years = 5)
This will produce 5 policy years of 10 policies each.
During simulation we distinguish between new and renewal business and also allow the set of policies to grow and/or contract. This permits us to examine different scenarios for change in business composition and the effect they have on loss settlement patterns. In particular, we are interested in situations where subgroups change in size and may distort the aggregate loss reserve estimate. If not needed or wanted, the growth and retention parameters may be set to unity for all simulated years.
<- policies_simulate( tbl_policy n = 10, num_years = 5, retention = 0.9, growth = 0.1)
This will generate five policy years, the first of which will have 100 policies. In the first renewal period, 10% of the policies will non-renew and there will be new business growth of 10% of the expiring book. In this example, the retention and growth figurees are such that the total number of policies will remain fixed. One could also construct a scenario of growth or contraction as follows:
# Gradually expanding book of business <- policies_simulate( tbl_policy n = 100, num_years = 5, retention = 0.9, growth = 0.2) # Gradually contracting book of business <- policies_simulate( tbl_policy n = 100, num_years = 5, retention = 0.8, growth = 0.1)
An extreme case would be one in which the portfolio turns over every year:
<- policies_simulate( tbl_policy n = 100, num_years = 5, retention = 0.0, growth = 1.0)
The retention and growth rates may vary for each year by passing a vector in the argument. Note that the number of elements in the vector must be one less than the number of years being simulated.
<- policies_simulate( tbl_policy n = 100, num_years = 5, retention = c(0.95, 0.9, 0.85, 0.8), growth = c(0.25, 0.2, 0.1, 0.05))
Note that the retention and growth parameters need not be fixed as they are here. One could use a random number generator. Below, let’s assume that growth will be somewhere between 5% and 15%.
<- policies_simulate( tbl_policy n = 100, num_years = 5, retention = 0.9, growth = runif(4, .05, .15))
policies_renew will generate new and renewal policies, respectively for a pre-existing data frame. Note that it must correspond to the structure described below.
<- policies_renew(tbl_policy, retention = 0.8) tbl_renewals <- policies_grow(tbl_policy, growth = 0.2)tbl_new_business
A policy data frame will always have at least the following columns:
In addition, it’s possible to add further columns of descriptive information such as line of business or state as discussed below.
All policies are assumed to be annual and to have expiration dates which are one calendar day before their effective date.
It’s possible for a policy to be written with an effective date of February 29th in a leap year. In the following year, the effective date will change to March 1st. In addition, if a policy has an effective date of March 1, it will ordinarily expire on February 28th. However, in a leap year, it will expire on February 29th.
See, for example:
|Policy||Year||Effective Date||Expiration Date|
|ABC||Year 1||February 29, 2004||February 28, 2005|
|ABC||Year 2||March 1, 2005||February 28, 2006|
|XYZ||Year 1||March 1, 2003||February 29, 2004|
|XYZ||Year 2||March 1, 2004||February 28, 2005|
additional_columns parameter allows one to insert additional data into the data frame. Below, we add the columns “GL” and “CA” to identify the set of policies.
<- policies_simulate( tbl_gl_ca n = 5, num_years = 5, additional_columns = list(line = "GL", state = "CA"))
This may be used to construct a data frame of policy data with varying characteristics by binding individual simulations as below:
<- policies_simulate( tbl_gl_ca n = 500, num_years = 5, additional_columns = list(line = "GL", state = "CA"), retention = 0.5, growth = .01) <- policies_simulate( tbl_gl_ny n = 50, num_years = 5, additional_columns = list(line = "GL", state = "NY"), retention = 0.9, growth = .5) <- dplyr::bind_rows(tbl_gl_ca, tbl_gl_ny)tbl_gl
This results in a data frame which encompasses a mature, declining book with a small but rapidly growing one.
The PolicyholderID column is an integer which is used to uniquely track policies across renewal periods. For example, note that policy ids 1-5 appear in all periods, while policy ids 6-10 appear only in policy years 2 and 3 and policy ids 11-15 only appear in policy year 3.
<- policies_simulate( tbl_policy n = 5, policy_years = 1:3, growth = c(1, 0.5))
There are a few items that we may explore for future development: