The ModelPoints Space#
Model points
The ModelPoints space represents
a set of policy model points.
This space is parameterized with mp_file_id and space_name.
For each combination of mp_file_id and space_name values,
a dynamic subspace of this space is created,
representing a specific set of model points of space_name.
Parameters
- mp_file_id#
a string key representing a set of model points
- space_name#
a string key representing the name of a product space
References in the space
Example
The sample code below demonstrates how to examine the contents of
ModelPoints.
>>> import modelx as mx
>>> m = mx.read_model("IntegratedLife")
>>> m.ModelPoints["202401NB", "GMXB"].model_point_table()
product_id plan_id ... av_pp_init accum_prem_init_pp
point_id ...
1 GMDB PLAN_A ... 0 0
2 GMDB PLAN_A ... 0 0
3 GMDB PLAN_B ... 0 0
4 GMDB PLAN_B ... 0 0
5 GMAB PLAN_A ... 0 0
6 GMAB PLAN_A ... 0 0
7 GMAB PLAN_B ... 0 0
8 GMAB PLAN_B ... 0 0
[8 rows x 13 columns]
>>> m.ModelPoints["202401NB", "GMXB"].model_point_table_ext()
product_id plan_id ... dyn_lapse_param_id dyn_lapse_floor
point_id ...
1 GMDB PLAN_A ... DL001A 0.00
2 GMDB PLAN_A ... DL001A 0.00
3 GMDB PLAN_B ... DL001B 0.00
4 GMDB PLAN_B ... DL001B 0.00
5 GMAB PLAN_A ... DL002A 0.03
6 GMAB PLAN_A ... DL002A 0.03
7 GMAB PLAN_B ... DL002B 0.05
8 GMAB PLAN_B ... DL002B 0.05
[8 rows x 29 columns]
Formulas#
Reads a raw model point table from a file and returns it. |
|
Extends the raw model point table with product parameters and returns it. |
Cells Descriptions#
- model_point_table()[source]#
Reads a raw model point table from a file and returns it.
Returns a DataFrame representing a model point table read from a model point file. The model point table is for a product space identified by
space_name. By default, a CSV file is expected for the model point file. The path to the model point file is obtained from the value of the “model_point_dir” parameter inconst_params().The file name is constructed using a prefix,
mp_file_idandspace_name, all concatenated by underscores, followed by “.csv”. The prefix is obtained from the value of the “model_point_file_prefix” parameter inconst_params().
- model_point_table_ext()[source]#
Extends the raw model point table with product parameters and returns it.
Append product parameter columns to the raw model point table returned by
model_point_table(). The product parameters are obtained by passingspace_nametoproduct_params(). For each model point row in the raw model point table, a corresponding row that has matching “product_id” and “plan_id” values is appended.