Skip to contents

Creates a matrix with each historic origin year as row and as calendar year in columns and sums in upper right triangle of the matrix

Usage

convert_single2dev_year_triangle(
  cashflow,
  claims_orig_years,
  first_orig_year,
  last_orig_year
)

Arguments

cashflow

matrix with one row per claim and columns first_orig_year:last_orig_year

claims_orig_years

vector with origin years corresponding to claims in 'cashflow'

first_orig_year

desired first origin year

last_orig_year

desired last origin year

Value

matrix containing claims history triangle

Details

last_orig_year will automatically be treated as the last observed calendar year, so the resulting matrix is quadratic

Examples

cashflow <- matrix(0, nrow = 5, ncol = 3)
rownames(cashflow) <- paste0("Claim", as.character(1:5))
colnames(cashflow) <- 2010:2012
cashflow[c(1, 2, 3, 6, 7, 12, 14, 15)] <- 1000
claims_orig_years <- c(2010, 2010, 2010, 2012, 2012)
print(cbind(cashflow, claims_orig_years))
#>        2010 2011 2012 claims_orig_years
#> Claim1 1000 1000    0              2010
#> Claim2 1000 1000 1000              2010
#> Claim3 1000    0    0              2010
#> Claim4    0    0 1000              2012
#> Claim5    0    0 1000              2012
convert_single2dev_year_triangle(cashflow, claims_orig_years, 2010, 2012)
#>      2010 2011 2012
#> 2010 3000 2000 1000
#> 2011    0    0    0
#> 2012    0    0 2000