Skip to main content

This Python package implements fundamental methods for modeling life contingent risks, and closely follows the coverage of traditional topics in actuarial exams and standard texts such as the “Fundamentals of Actuarial Math - Long-term” exam syllabus by the Society of Actuaries, and “Actuarial Mathematics for Life Contingent Risks” by Dickson, Hardy and Waters.

Overview

The package comprises three sets of classes, which:

  1. Implement general actuarial methods

    • Basic interest theory and probability laws

    • Survival functions, expected future lifetimes and fractional ages

    • Insurance, annuity, premiums, policy values, and reserves calculations

  2. Adjust results for

    • Extra mortality risks

    • 1/mthly payment frequency using UDD or Woolhouse approaches

  3. Specify and load a particular form of assumptions

    • Recursion inputs

    • Life table, select life table, or standard ultimate life table

    • Mortality laws, such as constant force of maturity, beta and uniform distributions, or Makeham’s and Gompertz’s laws

Quick Start

  1. pip install actuarialmath

    • also requires numpy, scipy, matplotlib and pandas.

  2. Start Python (version >= 3.10) or Jupyter-notebook

    • Select a suitable subclass to initialize with your actuarial assumptions, such as MortalityLaws (or a special law like ConstantForce), LifeTable, SULT, SelectLife or Recursion.

    • Call appropriate methods to compute intermediate or final results, or to solve parameter values implicitly.

    • Adjust the answers with ExtraRisk or Mthly (or its UDD or Woolhouse) classes.

Examples

# SOA FAM-L sample question 5.7
from actuarialmath import Recursion, Woolhouse
# initialize Recursion class with actuarial inputs
life = Recursion().set_interest(i=0.04)\
                  .set_A(0.188, x=35)\
                  .set_A(0.498, x=65)\
                  .set_p(0.883, x=35, t=30)
# modfy the standard results with Woolhouse mthly approximation
mthly = Woolhouse(m=2, life=life, three_term=False)
# compute the desired temporary annuity value
print(1000 * mthly.temporary_annuity(35, t=30)) #   solution = 17376.7
# SOA FAM-L sample question 7.20
from actuarialmath import SULT, Contract
life = SULT()
# compute the required FPT policy value
S = life.FPT_policy_value(35, t=1, b=1000)  # is always 0 in year 1!
# input the given policy contract terms
contract = Contract(benefit=1000,
                    initial_premium=.3,
                    initial_policy=300,
                    renewal_premium=.04,
                    renewal_policy=30)
# compute gross premium using the equivalence principle
G = life.gross_premium(A=life.whole_life_insurance(35), **contract.premium_terms)
# compute the required policy value
R = life.gross_policy_value(35, t=1, contract=contract.set_contract(premium=G))
print(R-S)   # solution = -277.19

Resources

  1. Jupyter notebook or run in Colab, to solve all sample SOA FAM-L exam questions

  2. User Guide, or download pdf

  3. API reference

  4. Github repo and issues

Release files for actuarialmath 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for actuarialmath 1.1.0
File Size Uploaded
actuarialmath-1.1.0.tar.gz 63.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for actuarialmath 1.1.0
File Interpreter ABI Platform
actuarialmath-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 135.8 kB

Release files / actuarialmath-1.1.0.tar.gz

Download URL actuarialmath-1.1.0.tar.gz
Size 63.2 kB
Tags Source
SHA-256 checksum
How to use checksums
5eba5480a1cb53faedd6823c0d735ed450211c89f03a8826b016e8b84dd16dfa
BLAKE2b-256 checksum
How to use checksums
911c040643cc529aecd0044ab08799b3dc440e85ccd3516e3fae8c99a98ea88c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Release files / actuarialmath-1.1.0-py3-none-any.whl

Download URL actuarialmath-1.1.0-py3-none-any.whl
Size 72.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b19990e4378aaa19fe6bc1182b4269faec6617cb62b0677fea1e624fbbb3ff6f
BLAKE2b-256 checksum
How to use checksums
3fae9d2653d7a10280c717574ef7c675b5af6fea3be3ec7aaf608594e8b4fc4b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.2

2 release files

1.0.1

2 release files

0.1.1

2 release files

0.0.15

2 release files

0.0.14

2 release files

0.0.13

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page