Lactuca Documentation#

Life actuarial calculations for Python — precise, fast, production-ready

Lactuca is a high-performance library for life actuarial calculations, consistent with international actuarial standards. It covers life contingencies, insurances, annuities, multiple-decrement models, and interest rate scenarios — built with Cython for maximum speed and vectorised with NumPy.

Quick Start

Get started with Lactuca in minutes. Load actuarial tables, calculate life annuities, and explore the core API.

Getting Started
User Guide

Step-by-step guides covering tables, calculation modes, interest rates, joint-life calculations, off-anniversary reserves, and more.

User Guide
Actuarial Formulas

Mathematical foundations and actuarial formulas used throughout the library, with LaTeX notation.

Actuarial Formulas
API Reference

Complete API documentation with detailed function signatures, parameters, and examples for all modules.

API Reference

Features#

Tables

  • Aggregate, select-ultimate, static and generational tables — all major table structures supported

  • Ready-to-use bundled tables from Spain, Germany, Chile, USA — see the complete list

  • Generational mortality with exponential and linear improvement scales

Calculations

  • Life, disability, and exit tables with multiple decrements

  • Annuities (discrete/continuous, immediate/due, fractional frequencies)

  • Life insurances (term, whole life, endowment)

  • Flexible interest rates with InterestRate class (constant/piecewise term structures)

  • Growth rate scenarios with GrowthRate class for benefit escalation

  • Fractional time shifts (ts) with configurable integer-enforcement policy

  • Actuarial date utilities (exact age calculation, anniversary dates)

Platform

  • Highly optimised with NumPy vectorisation and Cython compilation

  • IDE-friendly: full autocompletion in Jupyter and VS Code via stub files (.pyi)

Indices#