This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data(NAIC) | |
bigCompany = as.character(NAIC[which(NAIC$CumulativePaid == max(NAIC$CumulativePaid)),"GroupName"]) | |
df.BigCo = subset(NAIC, GroupName == bigCompany) | |
df.UpperTriangle = subset(df.BigCo, DevelopmentYear <=1997) | |
MeasureName = colnames(df.UpperTriangle)[5:10] | |
MeasureMeta = data.frame(MeasureName = as.character(MeasureName), Cumulative = as.character(c(rep("Cumulative", 2), rep("Neither", 4)))) | |
rm(MeasureName) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#================================================================================================== | |
# User-friendly constructor | |
# This is a giant pile of code which basically does the following: | |
# * Ensure that we have a proper date for the loss period start | |
# * Ensure that we have a column for the development lag | |
# * Once those have been established, create columns for loss period start and end, create a column | |
# for development period (based on lubridate Period class), compute the evaluation date. | |
Triangle = function(TriangleData | |
, TriangleName | |
, LossPeriodType = "accident" |
NewerOlder