Description Usage Arguments Examples
Claim simulation at line/type/status level
1 2 3 4 5 6 7 | claimSimulation(object, ...)
## S4 method for signature 'Simulation'
claimSimulation(object, claimData = data.frame(),
startDate = as.Date("2012-01-01"),
evaluationDate = as.Date("2016-12-31"),
futureDate = as.Date("2017-12-31"), append = TRUE)
|
object |
Simulation object |
... |
Additional parameters that may or may not be used. |
claimData |
claim data including existing claims for RBNER and claim reopenness analysis; |
startDate |
Date after which claims are analyzed; |
evaluationDate |
Date of evaluation for existing claims and IBNR; |
futureDate |
Date of evaluation for UPR (future claims). |
append |
Boolean variable to indicate whether existing simulation results need to be kept. |
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 | library(cascsim)
data(claimdata)
lines <- c("Auto")
types <- c("N")
AutoN <- new("ClaimType", line = "Auto", claimType = "N")
AutoN@exposureIndex <- setIndex(new("Index",indexID="I1",tabulate= FALSE,
startDate=as.Date("2012-01-01"), annualizedRate = 0)) # level exposure across time
AutoN@frequency <- new("Poisson", p1 =50)
AutoN@severityIndex <- setIndex(new("Index",indexID="I2",tabulate= FALSE,
startDate=as.Date("2012-01-01"), annualizedRate = 0.02)) #assuming a 2% annual inflation
AutoN@severity <- new("Lognormal", p1 =2, p2 =3)
AutoN@deductible <- new("Empirical", empirical=matrix(c(0,1,100,100),2,2))
AutoN@limit <- new("Empirical", empirical=matrix(c(0,1,1e8,1e8),2,2))
AutoN@p0<-new("DevFac",meanList=c(0,0),volList=c(0,0))
AutoN@reportLag <- new("Exponential", p1 =0.1)
AutoN@settlementLag <- new("Exponential", p1 =0.05)
AutoN@iCopula <- TRUE #use copula
AutoN@ssrCopula <- new("CopulaObj", type ="normal", dimension = 3,
param = c(0.1,0.2,0.1))#A Gaussian Copula
AutoN@ssrCopula@marginal <- c(AutoN@severity,AutoN@settlementLag,AutoN@reportLag)
AutoN@laeDevFac <- new("DevFac",FacID="F1",FacModel= TRUE,fun="linear",
paras =c(5,1.5,0.005,1.2,3))
AutoN@fIBNER <- new("DevFac",FacID="D1",FacModel= FALSE,
meanList =c(1.2,1.15,1.1,1.05,1),volList =c(0,0,0,0,0))
AutoN@reopen <- new("DevFac",FacID="D2",FacModel= FALSE,
meanList =c(0.02,0.015,0.01,0.005,0),volList =c(0.003, 0.002, 0.001, 0.001, 0))
AutoN@roDevFac <- new("DevFac",FacID="D3",FacModel= FALSE,
meanList =c(1.05,1.1,1,1,1),volList =c(0.00589,0.0037,0.00632,0.00815,0))
AutoN@reopenLag <- new("Exponential", p1 =0.01)
AutoN@resettleLag <- new("Exponential", p1 =0.25)
simobj <- new("Simulation", lines=lines, types=types,
claimobjs= list(AutoN),workingFolder=tempdir())
simobj@simNo <- 1
simobj@iRBNER <-FALSE
simobj@iROPEN <-FALSE
simobj@iIBNR <-TRUE
simobj@iUPR <-FALSE
simdata <- claimSimulation(simobj,claimdata, startDate = as.Date("2012-01-01"),
evaluationDate = as.Date("2016-12-31"), futureDate = as.Date("2017-12-31"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.