Programming actuary

An actuary combines skills from 3 areas: mathematics, economics and IT. The focus of this post will be on the last area - IT. I will share my view of which computer skills are the most important for actuaries.

Diagram with actuarial skill set: mathematics, economics and information technology.

Actuarial skill set

Actuaries combine skills from 3 areas:

  • mathematics
  • economics
  • IT

Mathematics

Actuaries deal with numbers daily. A lot of actuaries have a mathematical background and generally enjoy maths. Also, statistics is very important for actuaries. The knowledge of this subject is necessary to build probability-based mathematical models.

Economics

The actuarial calculations are set within the financial world. Actuarial models estimate the profitability of insurance products or capital requirements. Economics has an impact on calculations. For example, the time value of cash flows depends on the interest rates. Fund values depend on the return of underlying items.

IT

Actuaries deal with data on thousands of policies. They perform calculations using that data on computers. Without computers, it would take ages to derive results that nowadays we get in minutes. That's why Information Technology is a part of their woking life. In the following sections, we will discuss the programming skills that are useful for actuaries.

Programming skills

What IT skills should an actuary have? Should an actuary learn to code? If so, where to start?

In my view, an actuary should have skills in the following programming languages/software:

  • Excel + VBA
  • SQL
  • R / Python
  • git

Excel + VBA

Icon of Excel software.

Excel is a must for an actuary. I am not a fan of having Excel spreadsheets in the main flow of the actuarial processes. But they are (and will be) an important part of actuarial work. Excel is perfect for quick and dirty analysis of data, for notes and checks, etc.

To learn Excel, go through all the available icons in the spreadsheet.

Then learn often used functions, such as:

  • SUM(), SUMIFS()
  • COUNT(),
  • VLOOKUP(),
  • INDEX() + MATCH(),
  • IF(), IFERROR(),
etc.

It is also worth learning how to create pivot tables and simple charts. I recommend learning keyboard shortcuts which make the work with Excel much faster. And you look cool, too!

Once you feel comfortable with Excel, get to know the basics of Visual Basic for Applications (VBA). VBA allows us to automate tasks that otherwise we would have to do ourselves. The level of knowledge needed depends on how widespread VBA is in your company.

Still, it's good to know how to:

  • open the VBA script and assign macro to a button,
  • write simple scripts to, e.g.
    • copy data from one place to another,
    • insert timestamp,
    • save the spreadsheet,
  • use conditionals and loops,
  • encapsulate code in a function.

If you know these basics, you can tackle even more complex VBA scripts.

SQL

Icon of SQL language.

Actuaries work with data and data is stored in databases. Actuaries need a language to communicate with databases to get the data that they need. That language is Structured Query Language (SQL).

SQL varies between different types of databases (Oracle, SQL Server, PostgreSQL, etc.). Although if you know one flavour, it's easy to switch to another.

I recommend learning:

  • retrieving, inserting, updating and removing data (SELECT, INSERT, UPDATE, DELETE queries),
  • filtering data (WHERE clauses),
  • joining data from many tables (all the JOIN clauses),
  • aggregating grouped data (GROUP BY, HAVING).

The above skills should suffice for most of the "typical" actuary's database tasks.

R / Python

Icon of R language. Icon of Python language.

R and Python are the most popular languages among the actuaries. They are often used for data analytics as well as data science.

R is a programming language for statistical purposes. It is an easy language to learn and it is a great first programming language for actuaries.

What I would recommend learning is how to:

  • read data from files or databases,
  • write data back to files or databases,
  • transform data (clean, add columns, change columns based on data in other columns),
  • use conditionals, loops,
  • write functions, source external scripts,
  • draw graphs,
  • derive simple statistical models (lm, glm).

R has built-in packages as well as packages developed by the vibrant community. You might take a look at packages such as data.table or packages from so-called tidyverse. Data.table package helps handling big tables. Packages from the tidyverse help with data transformation, visualization, and much more.

Python is a good alternative for R. Python is a general-purpose language and it has a few packages that might be useful for actuaries. The most known are NumPy and Pandas.

git

Icon of git language.

Once you get a hang of R or Python, you should learn git. I assure you that you will love it. Git is a simple and powerful version control system.

You might have experienced "versioning" of Excel. Have you ever seen a folder like this: Folder with messy files. Nightmare!

Your coding will be more efficient if you combine R / Python with git. Thanks to git, you can keep track of all changes you make to the code. You can get back to the previous version or start a new branch of the code for new functionalities. You also keep track of who did the changes and when they did them.

With git, it's always obvious which version is the main version.

Conclusion

Computers are inevitable elements of actuarial lives. Knowing professional software and programming languages helps to be an efficient actuary.

Actuaries need to be able to store and retrieve data. SQL helps us to communicate with databases. Once we have the data we need, we can use R or Python for transformation and modelling. Git is there for the audibility of changes and keeping the code clean.

Actuaries also need to learn the professional software their insurance companies purchased. The best way to learn it is to read manuals and guidelines provided by the software's supplier.

Read also:

Log in to add your comment.