Skip to content

Instantly share code, notes, and snippets.

@PirateGrunt
Created July 3, 2013 19:47
Show Gist options
  • Save PirateGrunt/5922110 to your computer and use it in GitHub Desktop.
Save PirateGrunt/5922110 to your computer and use it in GitHub Desktop.
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment