4 Financial Mathematics (2): Miscellaneous Examples

Peter McQuire

4.1 Introduction

This chapter does not follow the typical style of most chapters in this book; there is no specific theme which it covers, consisting mainly of a series of examples and exercises based around topics included in a typical first year of an undergraduate programme for actuarial or financial mathematics. As such, this chapter should provide good practice to those readers new to writing code, and for consolidating one’s understanding of fundamental actuarial concepts.

Students may also wish to try the examples and exercises included in this chapter in Microsoft Excel, and compare the advantages and disadvantages with using R. Many tasks in this chapter are relatively simple compared with those in later chapters, such that Excel may be preferable in some cases. Throughout an actuary’s career decisions will often be required regarding the optimal software to use for a particular task.

The aims of this chapter are to:

  • cover miscellaneous topics typically studied in the first year of an undergraduate programme in actuarial science;
  • provide further practice in writing functions, and other code, in R;
  • apply functions, including those which exist in current R packages, to solve simple problems.

There is also an emphasis throughout the chapter (and in the book in general) on the importance of testing any code you write, and indeed checking any calculations. The skills learnt ...

Get R Programming for Actuarial Science now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.