The annuallife Library#
Overview#
The annuallife library packages TradLife_A, an
annual new business projection model of basic traditional life policies,
covering term, whole life and endowment products, built with modelx.
TradLife_A projects liability cashflows and their
present values for policies represented by model points. Projected items
include:
Premiums,
Commissions and expenses,
Claims.
Premiums are calculated using commutation functions.
Cells for investment income reserves are defined but not implemented.
See TradLife_A for more details.
Successor of simplelife#
The annuallife library is the updated successor of the legacy
Project simplelife project. Compared with the original
simplelife model, TradLife_A introduces:
Snake-case cell and reference names following the
basiclife.BasicTerm_SCnaming convention (for example,net_cfrather thanNetInsurCF,claimsrather thanBenefitDeath).Array-based model points. Policy attributes are read from input.xlsx as 1-D NumPy arrays and addressed by the integer parameter
idx(0-based) instead ofPolicyID(1-based).A flatter space layout.
AssumptionsandPolicyAttrsare top-level spaces instead of being nested insideProjection.A renamed input space. The space holding input.xlsx-backed References is now
InputDataand is referenced asinput_databy the rest of the model.
How to Use the Library#
As explained in the Copying a Library section, create your own copy of the annuallife library. For example, to copy as a folder named annuallife under the path C:\path\to\your\, type below in an IPython console:
>>> import lifelib
>>> lifelib.create("annuallife", r"C:\path\to\your\annuallife")
The TradLife_A model loads its data from input.xlsx,
which lives next to the model directory inside the library folder.
To read the model on the IPython console, change the working directory
to the library folder and use modelx’s read_model function:
>>> import modelx as mx
>>> m = mx.read_model("TradLife_A")
More detailed instructions on how to read, run and inspect the model
are described in the
Basic Usage section
of the TradLife_A documentation.
Older modelx versions#
TradLife_A is saved in the modelx serializer
version 7 format and requires modelx v0.31.0 or newer.
For users whose modelx is older than v0.31.0, the library also
includes TradLife_A_mx30, a copy of TradLife_A
saved in the older serializer version 6 format. It is the same model
and reads its data from the same input.xlsx. Read it instead with:
>>> import modelx as mx
>>> m = mx.read_model("TradLife_A_mx30")
Library Contents#
File or Folder |
Description |
|---|---|
|
The |
|
Copy of |
|
Excel workbook holding policy data, assumptions, mortality tables, scenarios and product specs. |
|
sphinx-gallery plot script that renders the cashflow chart. |
|
sphinx-gallery plot script that renders present-value cashflows. |
|
Jupyter notebook demonstrating cashflow projection. |
|
Tutorial notebook on the space tree of |