The Data Space#
Input data shared by every by-contract projection.
The six input CSVs are read here, once per model, and referenced from
Projection as data. Projection is
parameterized by idx, the position of a model point in the table, so each
Projection[i] is a separate ItemSpace with its own cells cache; if the readers lived
there, every model point would re-read every file.
Holding them in an unparameterized Space reads each file once no matter how many
contracts are projected.
Inputs are external files: plain CSVs in the model folder’s parent directory,
products/deferred_income_annuity/, rather than data stored inside the model. The
model folder therefore holds nothing but formulas — no _data/, no IOSpec, no
embedded values — so a diff of the model shows logic changes only. This follows
annuallife.TradLife_A; contrast basiclife.BasicTerm_S, which keeps its inputs
inside the model through modelx’s IOSpec machinery.
The consequence worth knowing: the model is not portable on its own. Copying the
DIA_US_SEC folder without its parent’s CSVs produces a model that reads and then
fails on first evaluation.
Four of the tables are DIA_US_S’s. The mortality table, the improvement scale and
the two factor tables are the files DIA_US_S reads, read here in place: one copy
of each table serves both models, so an edit to one reaches both. The model point table
and the premium schedule are this model’s own, model_point_table_sec.csv and
premium_schedule_sec.csv; they sit beside DIA_US_S’s model_point_table.csv
and premium_schedule.csv, which this model never opens.
input_dir() resolves the directory from _model.path.parent at run time, so the
model works wherever the repository is checked out. Each table has a filename Reference
and a reader Cells:
Reference |
Cells |
File |
|---|---|---|
model_point_file |
model_point_table() |
model_point_table_sec.csv |
premium_schedule_file |
premium_schedule_table() |
premium_schedule_sec.csv |
mort_table_file |
mort_table() |
mort_table.csv |
improvement_scale_file |
improvement_scale() |
improvement_scale.csv |
payout_factor_file |
payout_factor_table() |
payout_factor_table.csv |
rop_factor_file |
rop_factor_table() |
rop_factor_table.csv |
The model point table is checked as it is read. Ten of its columns are the in-force
interface: policy_count and duration_mth, as in basiclife.BasicTerm_SE, and
the eight columns of a contract’s opening state — each covered life’s survival at the
valuation date, the premiums paid and the income bought by then, the guarantee period the
kernel prices with, the two frozen cohort weights and the reference rate’s change since
issue. model_point_table() refuses a table that lacks any of them, repeats a
point_id, holds a count, a duration, a month or a contract term no contract can have,
or holds an opening state no contract can be in. The checks run in turn, and the first
that fails raises, naming the missing column or every point that fails it. It also
refuses a policy to be issued more than future_horizon_mth months after the valuation
date, 120 months as shipped: future new business is written over a stated horizon, so
that no frame runs longer than the stop rule from issue plus that horizon. Set to 0, the
Reference refuses future new business altogether. Whether a contract still owes a payment
at the valuation date is a rule of the product rather than of the table, and
Projection.proj_len checks it.
So is the premium schedule. A DIA is a flexible-premium contract: “any number of
premiums during the deferral period” [S2][S3][S4][R13], each buying its own paid-up income
slice at the purchase rate then in force. A fixed set of premium columns on the model
point table would cap that number, so the schedule is a long table keyed by point_id
with one row per slice, and premium_array() collapses it to a table of each point’s
premium by policy month, read by premium_pm(), as
DIA_US_S’s premium_by_mth collapses it to a month-to-amount mapping once per
contract. This model’s schedule holds the premiums
still due at the valuation date: those paid before it are in the contract’s opening
state, as the premiums paid and the income they bought. premium_schedule_table()
refuses a row that names no point of the table, a month or an amount no premium can have,
a premium before the valuation date or at or after the income start month, and a point
that buys no income at all, which DIA_US_S would project silently.
So are the four assumption tables, each by a count cell beside DIA_US_S’s reader,
which is unchanged: mort_table_count(), improvement_scale_count(),
payout_factor_count() and rop_factor_count(). Each reads its table’s keys by
value, once, as the per-point join in Projection matches them, so that an age written
70.0 is 70, and refuses a key that is blank, text or not a whole number, a sex or a
payout form no join reads, and a key on more than one row; the mortality table and the
improvement scale, read at every age from a life’s issue age up, refuse a gap in a sex’s
ages too. Each refuses a value that is blank, text, infinite or outside its table’s range.
Every message names the file, the column and the lines at fault. A rate, a scale or a
factor reaches the projection through survival and the purchase rates, where the refund
balance’s max(0, ·) and the payment factor’s max would lose a blank,
max(0.0, nan) being 0.0; mortality’s cap, written with the rate first, keeps it a NaN
until then. Each join asks its table’s count before it reads a value, so a projection
meets the checks first, and reads DIA_US_S’s frame.
The two factor tables are the pricing kernel’s data, and both are [std]. No
purchase-rate table was obtained and none is published — the Compact expressly relieves
the insurer of disclosing the deferral-period mortality and interest basis
[R13 §1.B(1)(a)] — so payout_factor_table.csv and rop_factor_table.csv carry the
technical notes’ illustrative factors, marked as such in their provenance columns.
A model point can bypass them entirely by setting factor_basis = "formula", which
computes equation (2) and the equation (3) mid-band approximation from the shipped
mortality table instead.
The mortality table and the improvement scale are keyed by (age, sex). They are
separate files on purpose: the technical notes prescribe the 2012 IAM Basic table
projected generationally with Projection Scale G2 [R9][REG-R59], two distinct
objects with distinct provenance, and neither may be embedded in the model — the shipped
tables are illustrative [std] stand-ins, the mortality table being the one that
reproduces the notes’ worked-example survival anchors. To swap in a licensed basis,
replace mort_table.csv with a same-schema file, or point mort_table_file at a
different name before the model computes anything. No formula changes. Replacing a file
changes DIA_US_S too, which reads the same one.
The vectors. The readers return what the files hold, and no
Projection cell but model_point and the cells kept for a reader,
the premium schedule’s two among them, reads them. The others read the arrays below
instead, one element at a time, a model point’s attribute being the element at its
position, data.issue_age()[idx]. That is what lets the model compile to C, as
basiclife.BasicTerm_SC does: each array is a numpy vector or table of int64 or
float64, which compiles to a typed memoryview, never one of bools, objects or text, and
each check of a table is an int. Each model point column a projection reads is one vector
of the column’s own name, read element by element as DIA_US_SEC read the point’s value
at stage E, float() of an amount or a rate, int() of an age, a month or a year;
and where a point’s value can be one its projection cannot use, a 0/1 vector beside it,
<column>_ok, says whether it is usable. The text the projection branches on is decoded
into 0/1 flags, each with a has_* flag that says the value is one DIA_US_S names.
The mortality table and the improvement scale, keyed by age and sex, are tabled by
schedule, one per sex, and age, padded from age 0, each point carrying the schedule of
each life’s sex. The two factor tables are row vectors, in the file’s order, each key a
number, read by a scan over the table’s rows. And the premium schedule is a table by point
and policy month:
Cells |
dtype |
Shape |
From |
|---|---|---|---|
point_id() |
int64 |
[point] |
the table’s index |
policy_count() |
float64 |
[point] |
|
duration_mth() |
int64 |
[point] |
|
duration_mth_ok() |
int64 |
[point] |
|
issue_age() |
int64 |
[point] |
|
issue_age_ok() |
int64 |
[point] |
|
joint_age() |
int64 |
[point] |
|
joint_age_ok() |
int64 |
[point] |
|
is_joint() |
int64 |
[point] |
|
survivor_pct() |
float64 |
[point] |
|
certain_period() |
int64 |
[point] |
|
certain_period_ok() |
int64 |
[point] |
|
income_start_mth() |
int64 |
[point] |
|
income_start_mth_ok() |
int64 |
[point] |
|
frequency() |
int64 |
[point] |
|
frequency_ok() |
int64 |
[point] |
|
cola_rate() |
float64 |
[point] |
|
issue_year() |
int64 |
[point] |
|
issue_year_ok() |
int64 |
[point] |
|
purchase_rate_dp() |
int64 |
[point] |
|
purchase_rate_dp_ok() |
int64 |
[point] |
|
adjust_mth() |
int64 |
[point] |
|
adjust_mth_ok() |
int64 |
[point] |
|
adjust_start_mth() |
int64 |
[point] |
|
adjust_start_mth_ok() |
int64 |
[point] |
|
accel_mth() |
int64 |
[point] |
|
accel_mth_ok() |
int64 |
[point] |
|
commute_mth() |
int64 |
[point] |
|
commute_mth_ok() |
int64 |
[point] |
|
commute_frac() |
float64 |
[point] |
|
other_qlac_premium() |
float64 |
[point] |
|
lives_if_init_1() |
float64 |
[point] |
|
lives_if_init_2() |
float64 |
[point] |
|
cum_premium_pp_init() |
float64 |
[point] |
the column |
annual_income_init() |
float64 |
[point] |
the column |
guarantee_mths_pricing_init() |
float64 |
[point] |
the column, NaN where blank |
surv_to_payout_init() |
float64 |
[point] |
the column, NaN where blank |
commute_weight_init() |
float64 |
[point] |
the column, NaN where blank |
ref_rate_shift_init() |
float64 |
[point] |
the column |
has_market_type() |
int64 |
[point] |
|
is_qlac() |
int64 |
[point] |
the same, 1 on QLAC |
has_income_form() |
int64 |
[point] |
|
is_life_only() |
int64 |
[point] |
the same, 1 on LO or LO_ROP |
is_cash_refund() |
int64 |
[point] |
the same, 1 on CR |
is_installment_refund() |
int64 |
[point] |
the same, 1 on IR |
is_period_certain() |
int64 |
[point] |
the same, 1 on PC |
has_db_form() |
int64 |
[point] |
|
is_rop() |
int64 |
[point] |
the same, 1 on ROP |
has_timing() |
int64 |
[point] |
|
is_arrears() |
int64 |
[point] |
the same, 1 on arrears |
has_reduction_trigger() |
int64 |
[point] |
|
is_trigger_either() |
int64 |
[point] |
the same, 1 on either |
has_mort_basis() |
int64 |
[point] |
|
is_generational() |
int64 |
[point] |
the same, 1 on generational |
has_factor_basis() |
int64 |
[point] |
|
is_formula_basis() |
int64 |
[point] |
the same, 1 on formula |
mort_sexes() |
int |
scalar |
mort_table.csv, checked |
mort_table_array() |
float64 |
[schedule, age] |
mort_table.csv |
mort_age_first() |
int64 |
[schedule] |
mort_table.csv |
mort_age_last() |
int64 |
[schedule] |
mort_table.csv |
mort_schedule_1() |
int64 |
[point] |
|
mort_schedule_2() |
int64 |
[point] |
|
improvement_sexes() |
int |
scalar |
the improvement scale, checked |
improvement_array() |
float64 |
[schedule, age] |
the improvement scale |
improvement_age_first() |
int64 |
[schedule] |
the improvement scale |
improvement_age_last() |
int64 |
[schedule] |
the improvement scale |
improvement_schedule_1() |
int64 |
[point] |
|
improvement_schedule_2() |
int64 |
[point] |
|
payout_income_start_age() |
int64 |
[row] |
the payout table |
payout_sex() |
int64 |
[row] |
the same, its sex numbered |
payout_form_code() |
int64 |
[row] |
the same, LO 1, CR 2, IR 3, PC 4 |
payout_factor_value() |
float64 |
[row] |
the same, its factor |
payout_schedule() |
int64 |
[point] |
|
rop_issue_age() |
int64 |
[row] |
rop_factor_table.csv |
rop_sex() |
int64 |
[row] |
the same, its sex numbered |
rop_deferral_years() |
int64 |
[row] |
the same |
rop_factor_value() |
float64 |
[row] |
the same, its factor |
rop_schedule() |
int64 |
[point] |
|
premium_width() |
int |
scalar |
the premium schedule |
premium_array() |
float64 |
[point, policy month] |
the same, summed by month |
premium_rows() |
int64 |
[point, policy month] |
the same, its rows by month |
premium_last() |
int64 |
[point] |
the same, the last month with a row; -1 where none |
Each age table is numbered by its own sexes, in sorted order, from schedule 1, so the two
tables need not hold the same sexes: mort_sexes() and improvement_sexes(), each
asking the table’s count cell first, give the count. Schedule 0 is a row of padding whose
first age is 1 and whose last is 0, so that no age lies between them: a life whose sex a
table lacks, a blank among them, has schedule 0 there, and Projection’s reader of the
table refuses it, naming the point, the age and the life, at the first age it reads, where
DIA_US_S’s .loc raised KeyError. The two factor tables number their sexes the
same way, each by its own, and Projection.payout_factor and Projection.rop_factor
scan the table’s rows for the point’s key, the first match its only one, since the count
cell refuses a key on two rows; a sex the table lacks, schedule 0, matches no row, and a
key no row holds is refused there, naming the point and the key. Neither table is held as
an array by its keys: DIA_US_S reads the ROP factor at every premium month, at an
attained age and a deferral no contract bounds, so an array sized by the keys would be
sized by the file’s largest, and both tables are a handful of rows.
The premium schedule is premium_array(), each point’s premiums by policy month,
0.0 in a month with none, read by Projection.premium_pm. A point’s rows are summed
month by month as DIA_US_S’s premium_by_mth sums them: its rows sorted by
premium_mth as DIA_US_S sorts them, each amount added in that order to the month’s
total from 0.0, so that a month with two rows holds DIA_US_S’s float to the last bit.
premium_rows() counts each month’s rows, so that Projection visits a month with
a premium of 0.0, as DIA_US_S’s dict holds it, and premium_last() is a point’s
last month with a row. The table is premium_width() months wide, the schedule’s
latest month and one, but no wider than premium_last_mth and one, 1,440: a premium
after policy month 1,439 belongs to a point whose income starts later than the caches
hold, which Projection.stop_mth, asked by Projection.proj_len, refuses before any
premium is read, so no premium a projection reads is left out. That bound keeps a month
far out, 1e10 say, from asking for a table of 80 GB a point before the point is
refused. The arrays hold 16 bytes a point and month, about 25 KB on the committed table,
about 1 KB a point, and up to 23 KB a point where income starts late.
What a point’s projection cannot use is refused where it reads it, by the point’s own
Projection cell, naming the point, never here: no point is refused for another’s
value, nor for a column its projection never reads, beyond what model_point_table()
refused at stage E, as it still does. Where a vector cannot hold a value, the vector
holds 0 there and its _ok flag 0, and the Projection accessor that reads the
element raises: on a blank or text value int() refuses, a single-life point’s blank
joint_age, which no projection reads, among them; and on an int of 2**53 or more in
size, which an int64 cannot be trusted to hold, since a float past int64 casts to the least
int64 without a word. DIA_US_S projects such a value as exact, so that is a recorded
refusal. The text the decodes branch on is compared exactly, case and whitespace included,
as DIA_US_S compares it, and a value DIA_US_S does not name sets no has_* flag,
so the decode that reads it raises DIA_US_S’s message there, as at stage E. And
point_id() refuses a label that is not a whole number below 2**53, naming every
label at fault, when a label is first read.
An array is read by element, never whole, in this Space as in
Projection. The compiler types an array cell as a memoryview only once
it has seen that every use of it, in either Space, is an element read: one len(),
slice, loop over it or numpy call on it anywhere, and the cell compiles as a Python object.
So an array derived here reads the table’s column, and a width comes from a table or a
check’s int, never from another cell’s array; each table’s check is one int cell that its
arrays, its extents and its schedules read first. The column keywords of
premium_schedule_table()’s DataFrame.assign are passed as **{...}, since a
keyword named as a cell of this Space, point_id, would be rewritten by the export. And
model_point_table() reads the file whole, low_memory=False, so that pandas types
each column once, not chunk by chunk, which on a large extract warned and changed nothing.
Cells Descriptions#
- input_dir()[source]#
The directory holding the input CSVs: the model folder’s parent.
Inputs are external files, not data stored inside the model, so the model folder is pure formulas. The path is resolved at run time from where the model was read, following
annuallife.TradLife_A.
- model_point_table()[source]#
The model point table, read from model_point_table_sec.csv and checked.
Indexed by
point_id. Ten columns are the in-force interface:policy_count, the contracts the point stands for, andduration_mth, the months elapsed from issue at the valuation date, as inbasiclife.BasicTerm_SE; then the opening state, per contract, as it stands at the start of month 0, before any month-0 event:lives_if_init_1andlives_if_init_2: each covered life’s probability of being alive at the valuation date, 1 or 0 on a real record, where a joint contract may carry one life already dead, and 0 for the second life of a single-life contract;cum_premium_pp_initandannual_income_init: the premiums paid and the guaranteed annual income they bought, per contract, before the valuation date;guarantee_mths_pricing_init: on a cash or installment refund in force, the guarantee period in months with which the pricing kernel prices every slice, a fixed point over the whole premium schedule; blank otherwise;surv_to_payout_init: where the income start month precedes the valuation month, the cohort that reached the income phase,l_last(T); blank otherwise;commute_weight_init: where the commutation month precedes the valuation month, the cohort that commuted,l_last(t_c); blank otherwise;ref_rate_shift_init: the reference rate at the valuation date less the reference rate at issue, as a decimal.
The rest are
DIA_US_S’s,pols_if_initrenamedpolicy_count, exceptrow_kind,source_policy_idandsource_mth, which record where the generator took each shipped row from and which no formula reads.The checks run over the whole table at once, and the first that fails raises
ValueError, naming the missing column or every point it fails on. First the table’s own shape:the ten in-force columns are present;
no
point_idappears twice;policy_countis a number, zero or more;duration_mthis a whole number of months, read by value, so that12.0is 12: positive for a contract in force, 0 for one issued at the valuation date, negative for one issued later;no policy is issued more than
future_horizon_mthmonths after the valuation date, soduration_mthis-future_horizon_mthor more. At 0 the model takes no future new business, and the message says so; a negative horizon is itself refused.
Then the contract’s terms, the income start month in force first, because the later checks read it:
income_start_mthis a whole number of months, 0 or more, a policy month;each option month,
adjust_mth,adjust_start_mth,accel_mthandcommute_mth, is blank or a whole number of months, a policy month; a negative month reads as never, asDIA_US_Sreads -1;the start-date adjustment’s two months go together, and the new start month follows the exercise, so the income start month in force,
adjust_start_mthwhere an adjustment is named andincome_start_mthotherwise, is a policy month after every premium priced to the old one;a start-date adjustment is a deferral option:
adjust_mthprecedes theincome_start_mthit moves, whereDIA_US_Swould pay nothing from that month to the exercise;an acceleration and a commutation, payout-phase options, fall at or after the income start month in force;
an acceleration and a commutation fall six months apart or more, the product’s interlock between its two payout options [S4]: inside the acceleration’s blackout,
DIA_US_S’s commuted value counts the instalments the lump sum has paid;jointis a flag, read by value:TrueorFalse, as pandas reads either, or 1 or 0, whereDIA_US_S’sbool()reads any text, a blank among them, asTrue;sexisMorF, and so isjoint_sexon a joint contract, the two values the tables keyed by sex hold;issue_age,certain_periodand, on a joint contract,joint_ageare whole numbers of years, 0 or more;frequencyis a whole number of payments a year andissue_yeara whole calendar year;purchase_rate_dpis blank or a whole number of decimal places, 0 or more. Each is read by value, so that60.0is 60;survivor_pctis a probability, andcola_rateandother_qlac_premiumnumbers zero or more, each reaching amaxor a comparison that would lose a blank;commute_fracis blank, for none, or a fraction, 0 to 1;the table basis is single-life: a joint contract carries
factor_basis = "formula".
Then the opening state:
each covered life is a probability, 0 to 1; the premiums paid and the income bought are numbers, zero or more; the guarantee period is blank or a number of months, zero or more; each frozen weight is blank or a probability; the reference rate’s change is a number, of either sign, the floor applying to the whole change since issue in
Projection.commute_disc_rate;a single-life contract has no second life:
lives_if_init_2is 0;a contract not yet in force,
duration_mth0 or less, holds its values at issue: each covered life 1, no premium paid, no income bought and no change in the reference rate;guarantee_mths_pricing_initis given exactly on a contract in force on a refund form,income_formCR or IR, and blank on every other: on new business the kernel derives it from the premium schedule, and the other forms fix it;surv_to_payout_initis given exactly whereduration_mthis after the income start month in force, andcommute_weight_initexactly where the commutation month precedesduration_mth: at or after the valuation month the projection derives each from the lives;a commutation is taken in the income phase by part of the cohort that reached it, so
commute_weight_initis at mostsurv_to_payout_init, and each frozen weight is at least the probability that a covered life is alive at the valuation date, the cohort it weighs including every life still alive;each frozen weight, where given, is above 0: a contract in force past its income start month reached it, and a commutation is exercised by an owner alive to exercise it, so neither cohort is empty. At 0 the guarantee of a contract whose lives have all died would pay nothing, a contract owing nothing that would project.
The table is returned with the columns those checks read by value, the policy months and the contract’s whole numbers and rates, as the numbers they were checked as (int64 where a whole-number column has no blank, float64 otherwise, blank as NaN), which the vectors below read with
int()andfloat(), andjointas the flags it was checked as. Whether the contract still owes a payment at the valuation date needs the certain period, which an installment refund derives inProjection, soProjection.proj_lenchecks it.The file is read whole,
low_memory=False, so that pandas types each column once, not chunk by chunk, which on a large extract warned and changed nothing. Every check here is stageE’s, and refuses the whole table, values a projection never reads among them: no check of that kind is added at stageEC, where a value a point’s projection cannot use is refused by that point’s projection alone.
The premiums still due, from premium_schedule_sec.csv, checked as they are read.
Long format, one row per premium slice, keyed by
point_id- deliberately not indexed, so that selecting a contract’s rows returns a DataFrame whether it has one slice or many - withDIA_US_S’s columns:point_id,slice,premium_mth, the policy month whose start the premium is paid at,premium_amt, the amount per contract, andprovenance. The point key is thepoint_idcolumn, and nothing else in the file names a point.It holds each contract’s premiums still due at the valuation date, the premiums of policy months
duration_mthand later, on a point in force, and its whole schedule on a point issued at or after the valuation date. A premium paid before the valuation date is in the contract’s opening state, incum_premium_pp_initand, through the slice it bought,annual_income_init, so the schedule holds none.It is checked against
model_point_table(), as checked, and the first check that fails raisesValueError, naming the column, the label or every point at fault:the
point_id,premium_mthandpremium_amtcolumns are present;each
point_idis a whole number, a model point’s label, below2**53in size, and labels a point of the model point table;each
premium_mthis a whole number of months, 0 or more, a policy month, read by value, so that60.0is 60, and below2**53, which an int64 holds exactly;DIA_US_Stakesint()of the raw month, so60.5is 60 there and text raises Python’s own message;each
premium_amtis a number, zero or more;no premium falls before the valuation date on a point in force,
premium_mthbelowduration_mth: those paid are in the opening state;no premium falls at or after the income start month in force. The product takes no premium within 13 months of it, and the projection’s payout schedule rests on a level income from the income start month on, as
DIA_US_S’s refund baseCP(T)does, which a premium after it would leave out;every point buys an income: a point with no income bought by the valuation date,
annual_income_init0, has a positive premium due.DIA_US_Sprojects a point with no premium row silently, with no premium and no income.
Returns the table with
point_idandpremium_mthas int64 andpremium_amtas float64, the numbers checked, every other column as read. The three columns are passed toDataFrame.assignas**{...}, sincepoint_idis a cell of this Space, which the export would rewrite as a keyword.
- improvement_scale()[source]#
The generational improvement scale by age and sex, from improvement_scale.csv.
- payout_factor_table()[source]#
The illustrative payout annuity factors, from payout_factor_table.csv.
Keyed by
(income_start_age, sex, payout_form); the value isa^(m)_y(f; i_p), the APV at the income start age of $1 per annum of income. [std] - no insurer publishes payout factors for this product.
- rop_factor_table()[source]#
The illustrative return-of-premium factors, from rop_factor_table.csv.
Keyed by
(issue_age, sex, deferral_years); the value isA_rop(x, d; i_p), the APV at the premium date of $1 payable at the end of the month of death within ad-year deferral. [std].
- mort_table_count()[source]#
The number of rows mort_table.csv gives a rate for, the table checked: an int.
mort_table()reads the table asDIA_US_Sreads it, and this cell checks it. Theagekey is read by value, once, asProjection.mort_rate_base_at’s join matches it, so an age written70.0is 70. An age that is blank, text or not a whole number is refused, naming the file, the column and the lines it is on; so is asexthat is notMorF, the two values a model point’s sex can take, a blank among them; so is an age and sex on more than one row, naming each with its lines; and so is a sex whose ages do not run one row an age, from its first to its last, the message naming each age missing. And so is amort_ratethat is blank, text, infinite or below 0, naming its lines: through the cap on mortality the rate reaches every survival probability, and a blank would survive the cap as a NaN, text fail far from here. A rate above 1 is accepted, and capped.Projection.mort_rate_base_at, the table’s one reader, asks for the count before it reads a rate, so a projection meets the checks first. So is an age of2**53or more in size, which an int64 cannot be trusted to hold, or below 0, sincemort_table_array()holds the table from age 0.
- improvement_scale_count()[source]#
The number of rows improvement_scale.csv gives a rate for, the table checked.
An int.
improvement_scale()reads the scale asDIA_US_Sreads it, and this cell checks its keys asmort_table_count()checks the mortality table’s, forProjection.improvement_rate_at’s join. And it refuses animprovement_ratethat is blank, text, infinite, or 1 or more, naming its lines: at 1 or more1 - G2is zero or negative, and the improved rate is 0 or changes sign with the calendar year. A negative rate is a deterioration, which the generational basis projects asDIA_US_Sdoes, the improved rate rising year on year, and it is accepted.Projection.improvement_rate_at, the scale’s one reader, asks for the count before it reads a rate, so a projection meets the checks first. An age of2**53or more in size, or below 0, is refused asmort_table_count()refuses it.
- payout_factor_count()[source]#
The number of rows payout_factor_table.csv gives a factor for, the table checked.
An int.
payout_factor_table()reads the table asDIA_US_Sreads it, and this cell checks it forProjection.payout_factor’s join, which reads one key a point. Anincome_start_agethat is blank, text or not a whole number is refused, naming the file, the column and the lines it is on; so is asexthat is notMorFand apayout_formthat is notLO,CR,IRorPC, the forms the join reads, a blank among them; and so is a key on more than one row, naming each with its lines. And so is apayout_factorthat is blank, text, infinite or not above zero, naming its lines: the factor divides the purchase rate, throughProjection.annuity_factor_def, whereDIA_US_S’s guard turns a factor of zero into a purchase rate of 0, a premium that buys nothing.Projection.payout_factorasks for the count before it reads a factor, so a projection meets the checks first. Anincome_start_ageof2**53or more in size, which an int64 cannot be trusted to hold, is refused too.
- rop_factor_count()[source]#
The number of rows rop_factor_table.csv gives a factor for, the table checked.
An int.
rop_factor_table()reads the table asDIA_US_Sreads it, and this cell checks it forProjection.rop_factor’s join, which reads one key a premium. Anissue_ageor adeferral_yearsthat is blank, text or not a whole number is refused, naming the file, the column and the lines it is on; so is asexthat is notMorF, a blank among them; and so is a key on more than one row, naming each with its lines. And so is arop_factorthat is blank, text, infinite or below zero, naming its lines; zero is a return of premium that costs nothing.Projection.rop_factorasks for the count before it reads a factor, so a projection meets the checks first. A key of2**53or more in size, which an int64 cannot be trusted to hold, is refused too.
- point_id()[source]#
The model points’ labels, int64 by position: the table’s
point_idindex.The label
Projection.point_idreports for a position, and the one every refusal names. Read by value, so that a label written3.0is 3, and refused when a label is first read, naming every label at fault, where one is not a whole number, text and a blank among them, or is2**53or more in size: the labels are the table’s keys, as in the family’s other compiled models. A projection that names no point reads no label, and runs.
- policy_count()[source]#
The
policy_countcolumn, float64 by point, asmodel_point_table()checked it.
- duration_mth()[source]#
The
duration_mthcolumn, int64 by point:int()of each value, 0 whereduration_mth_ok()is 0.model_point_table()has refused a value that is not a whole number, read by value, so that12.0is 12.
- duration_mth_ok()[source]#
1 where
int()reads the point’sduration_mthbelow2**53in size.0 on a value
int()refuses, a blank or text, and on a number the int64 vector cannot be trusted to hold; a number read as one,12.0, is 12.
- issue_age()[source]#
The
issue_agecolumn, int64 by point:int()of each value, 0 whereissue_age_ok()is 0.
- issue_age_ok()[source]#
1 where
int()reads the point’sissue_agebelow2**53in size, asduration_mth_ok().
- joint_age()[source]#
The
joint_agecolumn, int64 by point:int()of each value, 0 wherejoint_age_ok()is 0, a single-life point’s blank among them.
- joint_age_ok()[source]#
1 where
int()reads the point’sjoint_agebelow2**53in size.As
duration_mth_ok(). A single-life point’s blank is 0 here, and no projection of such a point reads it.
- is_joint()[source]#
The
jointcolumn, int64 by point: 1 wheremodel_point_table()checked it True.
- survivor_pct()[source]#
The
survivor_pctcolumn, float64 by point, asmodel_point_table()checked it, a probability.
- certain_period()[source]#
The
certain_periodcolumn, int64 by point:int()of each value, 0 wherecertain_period_ok()is 0.
- certain_period_ok()[source]#
1 where
int()reads the point’scertain_periodbelow2**53in size, asduration_mth_ok(). Only a period certain reads it.
- income_start_mth()[source]#
The
income_start_mthcolumn, int64 by point:int()of each value, 0 whereincome_start_mth_ok()is 0.
- income_start_mth_ok()[source]#
1 where
int()reads the point’sincome_start_mthbelow2**53in size, asduration_mth_ok().
- frequency()[source]#
The
frequencycolumn, int64 by point:int()of each value, 0 wherefrequency_ok()is 0.Any whole number is held;
Projection.payment_freqrefuses one that is not 12, 4, 2 or 1, withDIA_US_S’s message.
- frequency_ok()[source]#
1 where
int()reads the point’sfrequencybelow2**53in size, asduration_mth_ok().
- cola_rate()[source]#
The
cola_ratecolumn, float64 by point, asmodel_point_table()checked it, a number zero or more.
- issue_year()[source]#
The
issue_yearcolumn, int64 by point:int()of each value, 0 whereissue_year_ok()is 0.
- issue_year_ok()[source]#
1 where
int()reads the point’sissue_yearbelow2**53in size, asduration_mth_ok(). Only the generational basis and the calendar year read it.
- purchase_rate_dp()[source]#
The
purchase_rate_dpcolumn, int64 by point: -1 where blank, for full precision, asProjection.purchase_rate_dpreads it at stageE,int()of the value elsewhere, and 0 wherepurchase_rate_dp_ok()is 0.
- purchase_rate_dp_ok()[source]#
1 where
purchase_rate_dp()holds the point’s value: blank, or below2**53in size.
- adjust_mth()[source]#
The
adjust_mthcolumn, int64 by point: -1 where blank, for never,int()of the value elsewhere, and 0 whereadjust_mth_ok()is 0.
- adjust_mth_ok()[source]#
1 where
adjust_mth()holds the point’s month: blank, or below2**53in size.
- adjust_start_mth()[source]#
The
adjust_start_mthcolumn, int64 by point: -1 where blank, asadjust_mth().
- adjust_start_mth_ok()[source]#
1 where
adjust_start_mth()holds the point’s month: blank, or below2**53in size.
- accel_mth()[source]#
The
accel_mthcolumn, int64 by point: -1 where blank, asadjust_mth().
- accel_mth_ok()[source]#
1 where
accel_mth()holds the point’s month: blank, or below2**53in size.
- commute_mth()[source]#
The
commute_mthcolumn, int64 by point: -1 where blank, asadjust_mth().
- commute_mth_ok()[source]#
1 where
commute_mth()holds the point’s month: blank, or below2**53in size.
- commute_frac()[source]#
The
commute_fraccolumn, float64 by point: 0.0 where blank, for none, asProjection.commute_fracreads it at stageE.
The
other_qlac_premiumcolumn, float64 by point, asmodel_point_table()checked it.
- lives_if_init_1()[source]#
The
lives_if_init_1column, float64 by point: checked bymodel_point_table().
- lives_if_init_2()[source]#
The
lives_if_init_2column, float64 by point: checked bymodel_point_table().
The
cum_premium_pp_initcolumn, float64 by point: checked bymodel_point_table().
- annual_income_init()[source]#
The
annual_income_initcolumn, float64 by point: checked bymodel_point_table().
- guarantee_mths_pricing_init()[source]#
The
guarantee_mths_pricing_initcolumn, float64 by point, NaN where blank: given exactly on a refund form in force, asmodel_point_table()checks, and read only there.
- surv_to_payout_init()[source]#
The
surv_to_payout_initcolumn, float64 by point, NaN where blank: given exactly on a contract past its income start month, and read only there.
- commute_weight_init()[source]#
The
commute_weight_initcolumn, float64 by point, NaN where blank: given exactly where the commutation month precedes the valuation month, and read only there.
- ref_rate_shift_init()[source]#
The
ref_rate_shift_initcolumn, float64 by point: checked bymodel_point_table().
- has_market_type()[source]#
1 where the point’s
market_typeis one ofDIA_US_S’s four, compared exactly.
- has_income_form()[source]#
1 where the point’s
income_formis one ofDIA_US_S’s five, compared exactly.
- mort_sexes()[source]#
mort_table.csv’s sexes, an int: the number of schedules, the table checked first.
mort_table_count()checks the table as stageEdid, and refuses an age of2**53or more in size or below 0, naming its lines; this asks it first, so that every array, extent and schedule of the table, each of which asks this, meets the checks. Each sex is a schedule, numbered in sorted order from 1.
- mort_table_array()[source]#
mort_table.csv’s rates, float64 by schedule and attained age,
[s, x].Schedule
sis thes-th of the table’s sexes in sorted order, from 1; row 0, and every age below a sex’s first, is NaN padding, whichProjection.mort_rate_base_atnever reads, since it checks the age againstmort_age_first()andmort_age_last()first.
- mort_age_last()[source]#
Each mortality schedule’s last age, int64 by schedule: 0 on schedule 0, so that no age lies between its extents.
- mort_schedule_1()[source]#
The mortality schedule of each point’s
sex, int64 by point.The sex’s number in
mort_table_array(), matched asDIA_US_S’s.locmatches it, and 0 where the table lacks it, whichProjection.mort_rate_base_atrefuses where it first reads schedule 0.
- mort_schedule_2()[source]#
The mortality schedule of each point’s
joint_sex, int64 by point, asmort_schedule_1(): 0 on a single-life point’s blank, which nothing reads.
- improvement_sexes()[source]#
improvement_scale.csv’s sexes, an int: the number of schedules, the scale checked first by
improvement_scale_count(), and numbered by its own sexes, asmort_sexes()numbers the mortality table’s: the two need not hold the same ones.
- improvement_array()[source]#
improvement_scale.csv’s rates, float64 by schedule and attained age,
[s, x], padded asmort_table_array()is.
- improvement_age_first()[source]#
Each improvement schedule’s first age, int64 by schedule: 1 on schedule 0.
- improvement_age_last()[source]#
Each improvement schedule’s last age, int64 by schedule: 0 on schedule 0.
- improvement_schedule_1()[source]#
The improvement schedule of each point’s
sex, int64 by point, numbered by the scale’s own sexes, asmort_schedule_1()by the table’s.
- improvement_schedule_2()[source]#
The improvement schedule of each point’s
joint_sex, int64 by point, asimprovement_schedule_1().
- payout_income_start_age()[source]#
payout_factor_table.csv’s
income_start_age, int64 by row, in the file’s order.Read by value, as
payout_factor_count(), asked first, checked it, so that an age written80.0is 80.Projection.payout_factorscans the rows for its key.
- payout_sex()[source]#
payout_factor_table.csv’s
sex, int64 by row, numbered by the table’s own sexes in sorted order from 1, aspayout_schedule()numbers a point’s.
- payout_form_code()[source]#
payout_factor_table.csv’s
payout_form, int64 by row: LO 1, CR 2, IR 3 and PC 4, the formspayout_factor_count()admits, whichProjection.payout_factornumbers from the decodes.
- payout_factor_value()[source]#
payout_factor_table.csv’s
payout_factor, float64 by row, aspayout_factor_count()checked it.
- payout_schedule()[source]#
Each point’s
sexin payout_factor_table.csv’s numbering, int64 by point.As
payout_sex()numbers the table’s rows, and 0 where the table lacks the sex, which matches no row, soProjection.payout_factorrefuses it on the table basis.
- rop_issue_age()[source]#
rop_factor_table.csv’s
issue_age, int64 by row, in the file’s order, read by value asrop_factor_count(), asked first, checked it.
- rop_sex()[source]#
rop_factor_table.csv’s
sex, int64 by row, numbered by the table’s own sexes in sorted order from 1, asrop_schedule()numbers a point’s.
- rop_deferral_years()[source]#
rop_factor_table.csv’s
deferral_years, int64 by row, read by value asrop_factor_count()checked it.
- rop_factor_value()[source]#
rop_factor_table.csv’s
rop_factor, float64 by row, asrop_factor_count()checked it.
- rop_schedule()[source]#
Each point’s
sexin rop_factor_table.csv’s numbering, int64 by point, 0 where the table lacks it, aspayout_schedule().
The width of the premium tables, an int: the schedule’s latest policy month and one, no more than
premium_last_mthand one, and 1 on a schedule with no row.premium_schedule_table(), asked first, checks the schedule.premium_last_mth, 1,439, is the last policy month a premium of a point the compiled model’s caches hold can fall in,12 * (Projection.omega_age - Projection.issue_age_min) - 1, which this Space cannot read fromProjection: a test holds the two together.
Each point’s premiums still due, float64 by point and policy month,
[i, k].The rows of each point of
premium_schedule_table()sorted bypremium_mthasDIA_US_S’spremium_schedulesorts them, and each amount added in that order to its month’s total from 0.0, asDIA_US_S’spremium_by_mthadds it, so that a month with two rows holdsDIA_US_S’s float to the last bit. 0.0 in a month with no row, and on a point with none. A row afterpremium_width()’s last month is not held: its point’s income starts later thanProjection.proj_lenadmits.
The number of rows of each point’s schedule in each policy month, int64 by point and policy month,
[i, k], aspremium_array()holds them.DIA_US_S’spremium_by_mthholds a key for every month with a row, a premium of 0.0 among them, and its pricing guarantee visits each, soProjectionvisits a month with a row, not a month with a positive premium.
Each point’s last policy month with a row of the schedule, int64 by point: -1 on a point with none, and no later than
premium_width()’s last month.