Monday, 7 October 2013


Blog about F# for Actuarial Modelling

This blog will include a series of posts on the use of F# for Actuarial modelling. This will include the development of useful libraries of code and how best to leverage related libraries and tools.


What is F#?

According to Wikipedia:
"F# is an open-source, strongly typed, multi-paradigm programming language encompassing functional, imperative and object-oriented programming techniques.

F# is developed by the F# Software Foundation, Microsoft and open contributors. An open source, cross-platform edition of F# is available from the F# Software Foundation. F# is also a fully supported language in Visual Studio.

F# originated as a variant of ML and has been influenced by OCaml, C#, Python, Haskell,[1] Scala and Erlang."
Key items are both the backing for this language from Microsoft, but also from the open source community. The functional programming features include treating functions as values and supporting higher order functions (which take other functions as arguments), by default having variables set as immutable and supporting lazy evaluation.

Why F#? 

The functional programming features encourage the creation of concise mathematical code, very suitable for actuarial use.

The language also readily supports developing code that can run concurrently, very useful given the typical high performance requirements for actuarial modelling.

As F# is a .NET language, it can readily leverage the many libraries available in this environment, such as those created for mathematical, statistical and financial modelling.


How to get F#?

F# is available in a variety of environments, including a number of free of charge options. Please see these links on the  F# Software Foundation site:
The examples in this blog will be developed on Windows.


Blog Material

The initial series of blog posts will cover modelling of Life Contingencies, used in Life Insurance, Health Insurance and Pensions modelling.

The standard textbook that will be referred to will be:
Actuarial Mathematics for Life Contingent Risks by Dickson, Hardy and Waters

The code with be developed using MS Visual Studio 2012. Many of the examples will by presented using MS Excel 2010. To support this, we will use FCell, an F# tool developed by StatFactory.


  1. Hi. Really enjoying your posts. I just joined the F# train and just painlessly finished setting up F# on my Mac (I chose the Xamarin Studio option). I realized in your blogposts you use FCell. I tried to download the evaluation version from StatFactory and realized it was only available for Windows. Is there any workaround? Will really appreciate the help.

    1. Thanks for the comments. I have just double-checked with StatFactory on this and got confirmation that they don't currently support Mac's, but it might be worth logging this with them as a capability they might add in a future version. Quite a bit of the code should run OK separately or using the F# Interactive, although more recent blogs do focus on Excel and are really Windows only.