Reserving using machine learning - an advanced example in R (Part 2)

Part 2 of a set of 3 notebooks to replicate an example from a recent reserving paper
machine learning
talks
data
literature review
R
Author

Nigel Carpenter

Published

November 23, 2020

This article introduces the second of a series of three R notebooks. The notebooks provide R code to replicate the central scenario in the paper of Maximilien Baudry “NON-PARAMETRIC INDIVIDUAL CLAIM RESERVING IN INSURANCE”.

Introduction

Maximilien Baudry’s paper illustrates a novel approach, applying machine learning to individual claim transaction data in order to estimate both RBNS and IBNR reserves.

Baudry illustrates his approach with a simulated mobile phone insurance dataset. The working party has recreated Baudry’s mobile phone example in a series of 3 R notebooks that illustrate how to simulate the dataset, create the reserving database and apply machine learning reserving techniques, respectively.

In sharing example code we hope to make machine learning approaches more accessible and encourage further development and research among the wider actuarial community.

Details of suggested pre-reading and a link to the second notebook is given below.

Suggested pre-reading

Baudry’s use of granular and wide ranging data sources, in conjunction with carefully considered data preparation make this an advanced paper. I would therefore recommend reading Baudry’s original paper first.

We hope you will be encouraged to try the code and adapt it yourself. To do so you will need basic knowledge and access to the R programming language. The Foundations workstream provides links to suitable resources.

R Code Notebook

The second notebook takes the simulated mobile phone dataset from the first notebook and shows how to create a reserving database that can be used by machine learning techniques to calculate reserves. The second notebook prepares the data for use in modelling and can be found here.

This second notebook is a little more involved than the first so I recommend setting aside 20 - 30 minutes to read the notebook and to have read chapter 3 of Baudry’s original paper.

If you wish to experiment and run the code in your own local instance of R then I would recommend you set aside an hour or two, to give yourself time to install R libraries and follow the code line by line. Instructions and links to the source code can be found at the end of the Notebook.

October 2022 edit: The location of the source code has changed from that shown at the end of notebooks. It can now be found here.

Video

A presentation of this work is available here.

About the author


Copyright © Machine Learning in Reserving Working Party 2023