User Guide#
This guide covers all aspects of using Lactuca for actuarial calculations in Python.
Getting started#
- Getting Started
- Installation
- Quick example
- How Lactuca is organised
- Actuarial table types
- Loading a table
- Survival and mortality probabilities
- Life expectancy
- Commutation functions
- Interest rates
- Growth rates
- Configuration
- Life annuities
- Life insurances
- Disability tables
- Exit tables
- Functional API
- Time shift (
ts) for off-anniversary reserves - Next steps
- Support
Foundations#
Configuration#
Tables#
How to work with actuarial tables in Lactuca.
- Table Taxonomy
- Bundled Actuarial Tables
- Using Actuarial Tables
- Building Custom Table Files (.ltk)
- Column names and input formats
- Common construction parameters
- Single-rate and sex-independent tables
- Aggregate – Static tables
- Aggregate – Generational tables
- Select-Ultimate – Static tables
- Select-Ultimate – Generational tables
- Inspecting a
TableBuilder - Loading, round-tripping and cloning
TableBuilderparameter reference- See also
- Mortality Improvement (MI)
- Modifying Decrements
Core calculations#
Life annuities, life insurances, commutation functions, and related topics.
- Interest Rates
- Creating an InterestRate
- Discount factors
- Annuities on
InterestRate - Querying individual rates
- Effective rate over an interval
- Force of interest
- Accumulation factor
- Calculation mode (
Configis the source of truth) - Using with table methods
- Nominal rates
- Piecewise term structure — discount formula
- Calendar conventions and
days_per_year - EIOPA risk-free rate curve (Solvency II)
- Curve diagnostics (
curve_analysis/validate) - See also
- Life Annuities
- Life Insurances
- Prospective Reserves and the
tsParameter - Commutation Functions
- Integer-age requirement
- Independence from calculation settings
- Dependency chain
ex— complete expectation (not curtate)- Why \(\ddot{a}_x = N_x/D_x\)
- Definitions
- Continuous variants for fractional ages
- Using commutation functions in Lactuca
- Commutation formulas vs. direct engine methods
- Key actuarial formulas using commutation functions
- Notes
- See also
Lx,Tx, andlx_interpolation
- Deferred Life Contingencies
- Growth Rates
- Creating a GrowthRate
- Computing growth factors
- Using with table methods
- Anniversary convention
- Piecewise schedules and
shifted() - Combining growth and interest
- Inspecting a GrowthRate
- Mutating rates and terms
- Querying rates and segment metadata
- Validation reports
- Curve analysis
- Exporting
- Generating cashflow amounts
- See also
- Joint-Life Calculations
- Calculation Modes
- Decimal Precision and Rounding
- Numerical Precision
Productionizing / advanced#
- Functional API
- OOP style vs functional style
- Common parameters
- Controlling output precision
- Probability functions
- Life expectancy (
LifeTableonly) - Person-years functions (
LifeTableonly) - Life annuities (
LifeTableonly) - Life insurances (
LifeTableonly) - Commutation functions (
LifeTableonly) - Multi-life functions (
LifeTableonly) - Inspecting payment flows (
return_flows) - Batch with multiple tables
- Full function list
- Global calculation mode (
config.calculation_mode) - See also
- Batch Calculations
- Batch methods covered
- When to use batch mode
- Parameter compatibility reference
- Return-type rules
- Error handling in batch mode
- Single-table batch
- Multi-table batch (functional API)
- Joint-life batch
- Aggregate portfolio flows
- Cohort and duration: instance-level properties
- Pure financial annuities (
ir.a(),ir.ä()) - Performance notes
- DataFrame workflow
- See also
- Probable Flows and Portfolio Reserves
- Growth Rate Conventions
- Irregular Cashflows
- Parameters
- How it works
- Restrictions
- Use cases
- Design note: why due annuities exclude
cashflow_times - Interaction with
mandn - Inspecting the cashflows
- Performance notes
- Custom per-payment amounts on a uniform schedule
- Generating payment schedules with
payment_times - Life insurances with irregular cashflows
- See also
- Inspecting Cash Flows
- Force of Mortality Methods
- Last Payment Adjustment
- Date Utilities Guide