1 Introduction

The objective of this guide is to introduce the main concepts of programming to the actuarial community.

1.1 Background

The Institute and Faculty of Actuaries launched a revised exam curriculum in 2019. One of the reasons for doing so was because:

As a professional body the Institute and Faculty of Actuaries (IFoA) has a responsibility to ensure that the curriculum is relevant, up-to-date and reflects the skills, knowledge and attributes required of actuaries in an ever-changing global business environment.

— IFoA, Curriculum 2019

One of the noticeable additions to the syllabus was the inclusion of computer based examinations, some of which using the R programming language. The Working Party therefore felt that there was a need to provide an introduction to programming to students who are approaching coding for the first time in an exam setting.

In addition, there will be Associates and Fellows who would have completed their exams without this computer based education. This guide is therefore aimed at these members as well, in order to provide an introduction to their studies in this area.

1.2 Business Environment

As mentioned by the IFoA, the business enviroment is changing. The advance of technology has brought new software and hardware to the industry that has enabled computer based actuarial valuations. As computational power increased, more sophisticated analyses became available, allowing for stochastic modelling and scenario analyses to be performed using only a desktop PC. Furthermore, the explosion of data in recent years has enabled a far greater depth and breadth of analysis than was possible decades ago.

In addition to the evolution of technology, the expectations of regulators has also grown with the times. Models can be inspected and evaluated by regulators, and penal actions given to those firms who are not up to scratch. High standards of data protection are also expected following GDPR.

1.3 Advantages of Programming

Programming can help meet the challenges of today’s business enviroment. Big data sets can be handled by code, where some spreadsheeet applications are limited to a maximum number of rows and columns of data. Code packages and libraries are readily available on shared networks, allowing for the rapid prototyping of sophisticated models and analyses reliably. Additionaly, code can perform faster than bulky applications, given they are lower in the computational stack than higher (more abstract) applications that are managing more processes and are further away from the computations happening at the hardware level.

Aside from aiding actuarial work, programming knowledge can help actuaries extend their presense in fields outside of the traditional actuarial focus. For example, the algorithms behind data science and machine learning can be explored, web sites and apps can be built, and algorithmic trading can be employed using programming.

1.4 Outline of the guide

This guide is broadly split into three sections. The first considers the basics of coding; how to set up the programming environment and what are the basic components that can be used. The second section looks at how to organise code, considering different paradigms and common patterns, as well as how to manage version control. The final section then looks at some applications of programming, namely data visualisation and modelling.

Whilst some computer science courses may choose to explain code using “pseudo code”, the Working Party felt it more instructive to use an actual programming language in order to allow for repeatable examples that work. The natural choice was R given the changes included in the 2019 Curriculum. It should be noted that this guide is not an introduction to the R programming language - this has been done elsewhere and recommended reading is included in the final reference section.