The Assumptions Space#

Assumption input and calculations for individual policies.

This Space holds assumption parameters and rates used by Projection and its base spaces.

The main role of this Space is to associate assumption data sourced from InputData with the model points held in policy_data(), and to expose the resulting per-policy values as 1-D numpy arrays whose layout matches the rows of policy_data. Callers therefore index into them with the integer policy index idx. A few cells, such as asmp_tables() and mortality_tables(), return tables shared across all policies.

The association is carried out by chaining two helper cells inherited from the Utilities base Space:

  • map_to_policies() reindexes an assumption Series keyed by lookup columns (e.g. Product, PolType, Gen) onto the rows of policy_data, so the result has one entry per policy.

  • pandas_to_array() then converts that Series (or a DataFrame, for table-returning cells) into a NumPy array when return_array is True (the default). When return_array is False the pandas object is passed through unchanged, which is convenient for inspection and debugging.

A typical per-policy Cells in this Space therefore implements the following pipeline:

        graph LR
    A["input_data.assumption(key)<br/>pandas Series keyed by<br/>(Product, PolType, Gen)"]
    --> B["map_to_policies<br/>reindex onto<br/>policy_data rows"]
    B --> C["pandas_to_array<br/>convert when<br/>return_array=True"]
    C --> D["1-D NumPy array<br/>indexed by policy idx"]
    

For example, comm_init_prem() is implemented as pandas_to_array(map_to_policies(input_data.assumption('CommInitPrem'))), and most other per-policy cells in this Space follow the same pattern.

The three steps can also be executed individually on a console, which is useful for inspecting the intermediate pandas objects:

>>> asmp = m.Assumptions

>>> # Step 1: raw assumption Series keyed by lookup columns
>>> s = asmp.input_data.assumption('CommInitPrem')
>>> s
Product
TERM    0.2
WL      0.5
ENDW    0.5
Name: CommInitPrem, dtype: float64

>>> # Step 2: reindex onto the rows of policy_data
>>> mapped = asmp.map_to_policies(s)
>>> mapped.head()
Policy
1    0.2
2    0.2
3    0.2
4    0.2
5    0.2
Name: CommInitPrem, dtype: float64
>>> len(mapped)
300

>>> # Step 3: convert to a 1-D NumPy array (return_array is True)
>>> asmp.pandas_to_array(mapped)
array([0.2, 0.2, 0.2, ..., 0.5, 0.5, 0.5])

Composing the three calls is exactly what comm_init_prem() returns.

Parameters and References#

input_data#

Alias for InputData. Per-policy assumptions are read from the AssumptionTable range in input.xlsx via assumption(), and mortality / lapse tables from assumption_tables() and mortality_tables().

Inherited helpers

Inherited from Utilities:

Child spaces

  • AsmpID: Enum-style codes identifying entries in the AsmpByDuration table.

Cells Summary#

Commission Assumptions#

Per-policy initial and renewal commission rates and the renewal commission term.

comm_init_prem()

Initial commission per premium

comm_ren_prem()

Renewal commission per premium

comm_ren_term()

Renewal commission term

Expense Assumptions#

Per-policy acquisition and maintenance expense assumptions, expressed per annualized premium, per policy and per sum assured.

exps_acq_ann_prem()

Acquisition expense per annualized premium

exps_acq_pol()

Acquisition expense per policy

exps_acq_sa()

Acquisition expense per sum assured

exps_maint_ann_prem()

Maintenance expense per annualized premium

exps_maint_pol()

Maintenance expense per policy

exps_maint_sa()

Maintenance expense per sum assured

Tax and Inflation Assumptions#

The consumption tax rate and the expense inflation rate.

cnsmp_tax()

Consumption tax rate

inflation_rate()

Inflation rate

Mortality#

The mortality-table block and the per-policy indices that select each policy’s base mortality rates and its last mortality age.

mortality_tables()

Mortality tables read from input.xlsx.

mort_table_index()

Per-policy mortality table identifier.

mort_array_index()

Per-policy column index into mortality_tables().

last_mort_age()

Last mortality age per policy (first age where mortality reaches 1).

Mortality Factor and Lapse#

The assumption-by-duration table and the per-policy indices that select mortality factors and lapse rates, together with its row count.

asmp_tables()

Assumption tables by duration.

mort_factor_index()

Per-policy column index into asmp_tables() for mortality factors.

lapse_rate_index()

Per-policy column index into asmp_tables() for lapse rates.

asmp_table_len()

Number of rows (durations) in asmp_tables().

Cells Descriptions#

comm_init_prem()[source]#

Initial commission per premium

comm_ren_prem()[source]#

Renewal commission per premium

comm_ren_term()[source]#

Renewal commission term

exps_acq_ann_prem()[source]#

Acquisition expense per annualized premium

exps_acq_pol()[source]#

Acquisition expense per policy

exps_acq_sa()[source]#

Acquisition expense per sum assured

exps_maint_ann_prem()[source]#

Maintenance expense per annualized premium

exps_maint_pol()[source]#

Maintenance expense per policy

exps_maint_sa()[source]#

Maintenance expense per sum assured

cnsmp_tax()[source]#

Consumption tax rate

inflation_rate()[source]#

Inflation rate

mortality_tables()[source]#

Mortality tables read from input.xlsx.

Returns the full mortality-table block from the MortalityTables range as a 2-D NumPy array (when return_array is True), where rows are indexed by age and columns by (MortTable, Sex).

mort_table_index()[source]#

Per-policy mortality table identifier.

Maps the BaseMort assumption keyed by the model point lookup (product, policy type, gen) to each row of policy_data().

mort_array_index()[source]#

Per-policy column index into mortality_tables().

Returns a 1-D integer array of column positions in mortality_tables() for each policy’s (mort_table_index, sex) pair.

last_mort_age()[source]#

Last mortality age per policy (first age where mortality reaches 1).

asmp_tables()[source]#

Assumption tables by duration.

Returns the AsmpByDuration range from input.xlsx as a 2-D NumPy array indexed by duration (rows) and assumption ID (columns). Used by mort_factor() and lapse_rate() together with mort_factor_index() and lapse_rate_index().

mort_factor_index()[source]#

Per-policy column index into asmp_tables() for mortality factors.

Resolves each policy’s MortFactor assumption (referencing an AsmpID) to its column position in the AsmpByDuration table.

lapse_rate_index()[source]#

Per-policy column index into asmp_tables() for lapse rates.

Resolves each policy’s Surrender assumption (referencing an AsmpID) to its column position in the AsmpByDuration table.

asmp_table_len()[source]#

Number of rows (durations) in asmp_tables().