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 assumptionSerieskeyed by lookup columns (e.g.Product,PolType,Gen) onto the rows ofpolicy_data, so the result has one entry per policy.pandas_to_array()then converts thatSeries(or aDataFrame, for table-returning cells) into a NumPy array whenreturn_arrayisTrue(the default). Whenreturn_arrayisFalsethe 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 theAssumptionTablerange in input.xlsx viaassumption(), and mortality / lapse tables fromassumption_tables()andmortality_tables().
Inherited helpers
Inherited from Utilities:
Child spaces
AsmpID: Enum-style codes identifying entries in theAsmpByDurationtable.
Cells Summary#
Commission Assumptions#
Per-policy initial and renewal commission rates and the renewal commission term.
Initial commission per premium |
|
Renewal commission per premium |
|
Renewal commission term |
Expense Assumptions#
Per-policy acquisition and maintenance expense assumptions, expressed per annualized premium, per policy and per sum assured.
Acquisition expense per annualized premium |
|
Acquisition expense per policy |
|
Acquisition expense per sum assured |
|
Maintenance expense per annualized premium |
|
Maintenance expense per policy |
|
Maintenance expense per sum assured |
Tax and Inflation Assumptions#
The consumption tax rate and the expense inflation rate.
Consumption tax 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 read from input.xlsx. |
|
Per-policy mortality table identifier. |
|
Per-policy column index into |
|
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.
Assumption tables by duration. |
|
Per-policy column index into |
|
Per-policy column index into |
|
Number of rows (durations) in |
Cells Descriptions#
- mortality_tables()[source]#
Mortality tables read from input.xlsx.
Returns the full mortality-table block from the
MortalityTablesrange as a 2-D NumPy array (whenreturn_arrayisTrue), where rows are indexed by age and columns by(MortTable, Sex).
- mort_table_index()[source]#
Per-policy mortality table identifier.
Maps the
BaseMortassumption keyed by the model point lookup (product, policy type, gen) to each row ofpolicy_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.
- asmp_tables()[source]#
Assumption tables by duration.
Returns the
AsmpByDurationrange from input.xlsx as a 2-D NumPy array indexed by duration (rows) and assumption ID (columns). Used bymort_factor()andlapse_rate()together withmort_factor_index()andlapse_rate_index().
- mort_factor_index()[source]#
Per-policy column index into
asmp_tables()for mortality factors.Resolves each policy’s
MortFactorassumption (referencing anAsmpID) to its column position in theAsmpByDurationtable.
- lapse_rate_index()[source]#
Per-policy column index into
asmp_tables()for lapse rates.Resolves each policy’s
Surrenderassumption (referencing anAsmpID) to its column position in theAsmpByDurationtable.
- asmp_table_len()[source]#
Number of rows (durations) in
asmp_tables().