1 SAI “R for Actuaries” Talks

To gain an understanding of R’s current relevance in the actuarial world, a discovery phase was conducted. The foundation of this exploratory period was a series of talks organised by the Society of Actuaries in Ireland (SAI) revolving around the use of R by actuaries. The first talk was titled “R For Actuaries: What, Why and Where?” [23]. It was encouraging to discover that this talk was met with great interest and support from the SAI’s members. This initial feedback prompted a series of talks on how R can be useful in actuarial tasks. The additional three talks organised were titled “R for Actuaries: Graphing Better with R” [24], “R for Actuaries: Generalized Linear Models in R” [25] and “R for Actuaries: Data Processing with R” [26]. Throughout the series, the various presenters referenced the fact that R is “a free, portable, open-source language for statistical programming.” Breaking this down: there are no fees to be paid, the vast majority of packages are free, and R runs on any operating system. Additionally, anyone can contribute to its development, there is widespread online support and there exists a huge quantity of community packages.

The talks were useful in highlighting how R can add value to the day-to-day work performed by an actuary. The importance of actuaries presenting and communicating their findings effectively was considered. This is essential because actuaries are often consulting and dealing with those from a non-technical background. They need to be capable of relaying their findings and conclusions without over-reliance on complex mathematical or statistical reasoning. The “Graphing Better with R” talk [24] showcased that the graphical capabilities of R are remarkable. Libraries such as “ggplot2” [9] are impressive and provide comprehensive visualisation of results, which can greatly assist actuaries in presenting their work.

Additionally, actuaries often process data and manipulate large datasets. While it is the analysis of the data that creates the value for the firm, a significant amount of time is often spent on the data manipulation phase. The talks noted how the benefits of R can be leveraged here to speed up this process. R can restructure datasets, extract information, filter files and add files together with ease, efficiently outputting a file ready for analysis. R is capable of reading data from most formats, including files created in other statistical packages. Of particular relevance is the “readxl” package [13], which can be used to import Excel files.

On the analysis side, R is an environment for statistical computing and as such it can assist actuaries in performing advanced statistical modelling. R is a very useful tool for data generation and boasts advantages for creating new datasets based on random number generation. There exist high quality statistical packages that are well documented and allow for ease of sampling from distributions. When actuaries are working with random numbers, they may want the solution to be reproducible. The “set seed” function in R allows for this, so that the output is identical when the code is re-run. There is no such function built into Excel and generating reproducible results is more complex.

An interesting point made in these talks was the advantages that R presents in the area of peer review. A complex model built in Excel, for example, will generally have many tabs and macros. If an actuary wishes to hand this to a colleague for review, they will not only need to share the Excel file itself but also a document outlining assumptions and details on how to use the file. The logic may not be easy to follow. With R Markdown [28], the documentation and code are kept in a single location. The re-runnable code as well as any output, explanations and conclusions are readily viewable together. It is easy for actuaries to share their work with their colleagues through this one file and it also facilitates sharing work online.1

An issue referenced on more than one occasion is the low actuarial industry experience and the steep learning curve associated with R. A solution to this may be the recent addition of R to the Institute and Faculty of Actuaries’ (IFoA) curriculum [30]. There are now two core exams with the purpose of developing future actuaries’ skills in applying statistical methods to actuarial problems using the R environment. Students are now experiencing R as part of their degrees as well as in their qualifying exams. This suggests that the benefits that R can provide to the actuarial world will only continue to be recognised, developed, and capitalised on.

A key takeaway from these talks was that R is not just for data scientists. It has a great amount of functionality, some of which has even been designed with actuaries in mind. LifeContingencies [22], Actuar [31], and ChainLadder [32], are examples of actuarial R packages that were mentioned in these talks.

It is recognised that the non-life insurance industry has adopted R to a greater extent than the pensions and life sectors. However, a particularly encouraging aspect of the talks centred around a chief pricing actuary working in the life insurance sector, who migrated his entire office from Excel to R. Models to calculate future expected cash-flows are typically built within Excel or specialist cash-flow modelling platforms, however his office managed to rebuild such models in R. It was motivating to discover this firm’s success in utilising R. This showed that it was possible to fully embrace R in the actuarial industry.


  1. As previously discussed, this interactive report was published using R Markdown [28] and Bookdown [29]↩︎