public
Created

  • Download Gist
gistfile1.txt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
sourceFiles = "https://raw.github.com/PirateGrunt/MRMR/master/R/NAIC.R"
 
dummy = lapply(paste0(myDirectory, sourceFiles), source)
rm(myDirectory, sourceFiles, dummy)
 
dfAuto = GetNAICData(dataSetName = "comAuto_pos.csv")
dfWC = GetNAICData(dataSetName = "wkcomp_pos.csv")
dfGL = GetNAICData(dataSetName = "othliab_pos.csv")
dfProd = GetNAICData(dataSetName = "prodliab_pos.csv")
 
groups = intersect(unique(dfAuto$GroupName)
, unique(dfWC$GroupName)
, unique(dfGL$GroupName)
, unique(dfProd$GroupName))
 
groups = intersect(unique(dfAuto$GroupName), unique(dfWC$GroupName))
groups = intersect(groups, unique(dfGL$GroupName))
groups = intersect(groups, unique(dfProd$GroupName))
 
dfAuto = subset(dfAuto, GroupName %in% groups)
dfWC = subset(dfWC, GroupName %in% groups)
dfGL = subset(dfGL, GroupName %in% groups)
dfProd = subset(dfProd, GroupName %in% groups)
 
dfAuto$Line = "Auto"
dfWC$Line = "WC"
dfGL$Line = "GL"
dfProd$Line = "Products"
 
Multiline = rbind(dfAuto, dfWC, dfGL, dfProd)
 
rm(dfAuto, dfWC, dfGL, dfProd, groups)
 
myDirectory = "https://raw.github.com/PirateGrunt/MRMR/master/R/"
sourceFiles = c("TriangleOriginPeriod.R"
, "TriangleDevelopmentLag.R"
, "TriangleEvaluationDate.R"
, "TriangleOriginPeriod.R"
, "TriangleAdjustMeasures.R"
, "Triangle.R"
, "TriangleMeta.R")
 
dummy = lapply(paste0(myDirectory, sourceFiles), source)
 
measureCols = c("CumulativeIncurred", "CumulativePaid", "NetEP", "DirectEP", "CededEP", "IBNR")
MultilineTriangle = newTriangle(TriangleData = Multiline
, OriginPeriods = OriginPeriodStart
, OriginLength = years(1)
, StartDay = 1
, StartMonth = 1
, DevelopmentLags = DevelopmentLag
, DevelopmentPeriod = years(1)
, Groups = c("Line", "GroupName")
, Measures = measureCols
, Cumulative = TRUE)

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.