R functions that support the bootstrap simulation

This package contains R functions for two stage bootstrap simulations and loss triangle manipulations. The detail bootstrapping theory can be found in "Analytic and bootstrap estimates of prediction errors in claims reserving" from Peter England and Richard Verrall. The package contains various loss reserve triangle manipulations, including LDF, Weighted Average, etc. For detail implementations, please see the help pages below.

Here are simple steps to perform bootstrap simulation:

1. Download and install the "bootstrap" package, run R, and load the "bootstrap" package.

2. (optional) Prepare a paid loss triangle (download example) and save it in a .csv file, so that the R can read it. Make sure triangle has years and ages.

3. Run function bootstrap.load(), to load the triangle from the file dialog window

4. Run function bootstrap.start(round=1000, percentile=TRUE) to start the simulation in 1000 rounds. Try 100 first...

Results are presented either by a matrix of percentile format (if percentile=TRUE), or a matrix of reserves (percentile=FALSE)


Documentation for package ‘bootstrap’ version 1.0-1 (Help Pages)

Accumulate Accumulate an incremental triangle
add Add two triangles
bootstrap What the package does: This package will contain functions for two stage bootstrap simulation and loss triangle manipulations
bootstrap.load Load accumulated paid loss triangle and initialize the bootstrap object
bootstrap.start Start the two stages of bootstrap simulation
ChiSqr get the Chi Square (residual ^2) in preparing the bootstrap object
count Count the triangle cells
develop Fill the lower part of the triangle, using LDF from weighted average.
fit Get the fitted cumulative loss triangle
GammaTrial Do gamma simulation on incremental development triangle
getAges Get triangle ages
getDiagnal Get triangle cumulative data
getFittedIncrementalLoss Get Fitted Incremental Loss triangle for bootstrap object
getLDF Get the LDF from triangle, using weighted average.
getReserveFromLDF Calculate reserves from the weighted average LDF selection only
getResidual Get the residual of bootstrap object
getScale Get the scale of the gamma distribution from bootstrap object
getWeightedAvg Get weighted average of a triangle
getYears Get triangle years
Incremental Increment an accumulated triangle
minus Triangle A - Triangle B
print Pretty print a triangle object
readcsvfile Read a triangle object from csv file.
residual Calculate the residual triangle. r= (A-E)/E^.5
sample Sample with replacement--core bootstrap concept.
Simulate 2 stages of the bootstrap simulation
Sudo Get the "whatif" triangle after the first stage bootstraping simulation
summary Pretty summary a triangle object