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]

policy_count

duration_mth()

int64

[point]

duration_mth

duration_mth_ok()

int64

[point]

duration_mth, its flag

issue_age()

int64

[point]

issue_age

issue_age_ok()

int64

[point]

issue_age, its flag

joint_age()

int64

[point]

joint_age, 0 where blank

joint_age_ok()

int64

[point]

joint_age, its flag

is_joint()

int64

[point]

joint, 1 on True

survivor_pct()

float64

[point]

survivor_pct

certain_period()

int64

[point]

certain_period

certain_period_ok()

int64

[point]

certain_period, its flag

income_start_mth()

int64

[point]

income_start_mth

income_start_mth_ok()

int64

[point]

income_start_mth, its flag

frequency()

int64

[point]

frequency

frequency_ok()

int64

[point]

frequency, its flag

cola_rate()

float64

[point]

cola_rate

issue_year()

int64

[point]

issue_year

issue_year_ok()

int64

[point]

issue_year, its flag

purchase_rate_dp()

int64

[point]

purchase_rate_dp, -1 where blank

purchase_rate_dp_ok()

int64

[point]

purchase_rate_dp, its flag

adjust_mth()

int64

[point]

adjust_mth, -1 where blank

adjust_mth_ok()

int64

[point]

adjust_mth, its flag

adjust_start_mth()

int64

[point]

adjust_start_mth, -1 where blank

adjust_start_mth_ok()

int64

[point]

adjust_start_mth, its flag

accel_mth()

int64

[point]

accel_mth, -1 where blank

accel_mth_ok()

int64

[point]

accel_mth, its flag

commute_mth()

int64

[point]

commute_mth, -1 where blank

commute_mth_ok()

int64

[point]

commute_mth, its flag

commute_frac()

float64

[point]

commute_frac, 0.0 where blank

other_qlac_premium()

float64

[point]

other_qlac_premium

lives_if_init_1()

float64

[point]

lives_if_init_1

lives_if_init_2()

float64

[point]

lives_if_init_2

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]

market_type, 1 on one of four

is_qlac()

int64

[point]

the same, 1 on QLAC

has_income_form()

int64

[point]

income_form, 1 on one of five

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]

db_form, 1 on ROP or NONE

is_rop()

int64

[point]

the same, 1 on ROP

has_timing()

int64

[point]

timing, 1 on arrears or advance

is_arrears()

int64

[point]

the same, 1 on arrears

has_reduction_trigger()

int64

[point]

reduction_trigger, 1 on either or primary

is_trigger_either()

int64

[point]

the same, 1 on either

has_mort_basis()

int64

[point]

mort_basis, 1 on anchor or generational

is_generational()

int64

[point]

the same, 1 on generational

has_factor_basis()

int64

[point]

factor_basis, 1 on table or formula

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]

sex, joined; 0 where not

mort_schedule_2()

int64

[point]

joint_sex, joined; 0 where not

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]

sex, joined; 0 where not

improvement_schedule_2()

int64

[point]

joint_sex, joined; 0 where not

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]

sex, in the table’s numbering; 0 where not

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]

sex, in the table’s numbering; 0 where not

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, and duration_mth, the months elapsed from issue at the valuation date, as in basiclife.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_1 and lives_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_init and annual_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_init renamed policy_count, except row_kind, source_policy_id and source_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_id appears twice;

  • policy_count is a number, zero or more;

  • duration_mth is a whole number of months, read by value, so that 12.0 is 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_mth months after the valuation date, so duration_mth is -future_horizon_mth or 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_mth is a whole number of months, 0 or more, a policy month;

  • each option month, adjust_mth, adjust_start_mth, accel_mth and commute_mth, is blank or a whole number of months, a policy month; a negative month reads as never, as DIA_US_S reads -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_mth where an adjustment is named and income_start_mth otherwise, is a policy month after every premium priced to the old one;

  • a start-date adjustment is a deferral option: adjust_mth precedes the income_start_mth it moves, where DIA_US_S would 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;

  • joint is a flag, read by value: True or False, as pandas reads either, or 1 or 0, where DIA_US_S’s bool() reads any text, a blank among them, as True; sex is M or F, and so is joint_sex on a joint contract, the two values the tables keyed by sex hold;

  • issue_age, certain_period and, on a joint contract, joint_age are whole numbers of years, 0 or more; frequency is a whole number of payments a year and issue_year a whole calendar year; purchase_rate_dp is blank or a whole number of decimal places, 0 or more. Each is read by value, so that 60.0 is 60;

  • survivor_pct is a probability, and cola_rate and other_qlac_premium numbers zero or more, each reaching a max or a comparison that would lose a blank; commute_frac is 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_2 is 0;

  • a contract not yet in force, duration_mth 0 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_init is given exactly on a contract in force on a refund form, income_form CR 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_init is given exactly where duration_mth is after the income start month in force, and commute_weight_init exactly where the commutation month precedes duration_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_init is at most surv_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() and float(), and joint as 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 in Projection, so Projection.proj_len checks 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 stage E’s, and refuses the whole table, values a projection never reads among them: no check of that kind is added at stage EC, where a value a point’s projection cannot use is refused by that point’s projection alone.

premium_schedule_table()[source]#

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 - with DIA_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, and provenance. The point key is the point_id column, 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_mth and 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, in cum_premium_pp_init and, 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 raises ValueError, naming the column, the label or every point at fault:

  • the point_id, premium_mth and premium_amt columns are present;

  • each point_id is a whole number, a model point’s label, below 2**53 in size, and labels a point of the model point table;

  • each premium_mth is a whole number of months, 0 or more, a policy month, read by value, so that 60.0 is 60, and below 2**53, which an int64 holds exactly; DIA_US_S takes int() of the raw month, so 60.5 is 60 there and text raises Python’s own message;

  • each premium_amt is a number, zero or more;

  • no premium falls before the valuation date on a point in force, premium_mth below duration_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 base CP(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_init 0, has a positive premium due. DIA_US_S projects a point with no premium row silently, with no premium and no income.

Returns the table with point_id and premium_mth as int64 and premium_amt as float64, the numbers checked, every other column as read. The three columns are passed to DataFrame.assign as **{...}, since point_id is a cell of this Space, which the export would rewrite as a keyword.

mort_table()[source]#

The base annuitant mortality table by age and sex, read from mort_table.csv.

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 is a^(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 is A_rop(x, d; i_p), the APV at the premium date of $1 payable at the end of the month of death within a d-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 as DIA_US_S reads it, and this cell checks it. The age key is read by value, once, as Projection.mort_rate_base_at’s join matches it, so an age written 70.0 is 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 a sex that is not M or F, 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 a mort_rate that 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 of 2**53 or more in size, which an int64 cannot be trusted to hold, or below 0, since mort_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 as DIA_US_S reads it, and this cell checks its keys as mort_table_count() checks the mortality table’s, for Projection.improvement_rate_at’s join. And it refuses an improvement_rate that is blank, text, infinite, or 1 or more, naming its lines: at 1 or more 1 - G2 is 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 as DIA_US_S does, 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 of 2**53 or more in size, or below 0, is refused as mort_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 as DIA_US_S reads it, and this cell checks it for Projection.payout_factor’s join, which reads one key a point. An income_start_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 a sex that is not M or F and a payout_form that is not LO, CR, IR or PC, 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 a payout_factor that is blank, text, infinite or not above zero, naming its lines: the factor divides the purchase rate, through Projection.annuity_factor_def, where DIA_US_S’s guard turns a factor of zero into a purchase rate of 0, a premium that buys nothing. Projection.payout_factor asks for the count before it reads a factor, so a projection meets the checks first. An income_start_age of 2**53 or 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 as DIA_US_S reads it, and this cell checks it for Projection.rop_factor’s join, which reads one key a premium. An issue_age or a deferral_years that is blank, text or not a whole number is refused, naming the file, the column and the lines it is on; so is a sex that is not M or F, a blank among them; and so is a key on more than one row, naming each with its lines. And so is a rop_factor that is blank, text, infinite or below zero, naming its lines; zero is a return of premium that costs nothing. Projection.rop_factor asks for the count before it reads a factor, so a projection meets the checks first. A key of 2**53 or 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_id index.

The label Projection.point_id reports for a position, and the one every refusal names. Read by value, so that a label written 3.0 is 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 is 2**53 or 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_count column, float64 by point, as model_point_table() checked it.

duration_mth()[source]#

The duration_mth column, int64 by point: int() of each value, 0 where duration_mth_ok() is 0.

model_point_table() has refused a value that is not a whole number, read by value, so that 12.0 is 12.

duration_mth_ok()[source]#

1 where int() reads the point’s duration_mth below 2**53 in 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_age column, int64 by point: int() of each value, 0 where issue_age_ok() is 0.

issue_age_ok()[source]#

1 where int() reads the point’s issue_age below 2**53 in size, as duration_mth_ok().

joint_age()[source]#

The joint_age column, int64 by point: int() of each value, 0 where joint_age_ok() is 0, a single-life point’s blank among them.

joint_age_ok()[source]#

1 where int() reads the point’s joint_age below 2**53 in 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 joint column, int64 by point: 1 where model_point_table() checked it True.

survivor_pct()[source]#

The survivor_pct column, float64 by point, as model_point_table() checked it, a probability.

certain_period()[source]#

The certain_period column, int64 by point: int() of each value, 0 where certain_period_ok() is 0.

certain_period_ok()[source]#

1 where int() reads the point’s certain_period below 2**53 in size, as duration_mth_ok(). Only a period certain reads it.

income_start_mth()[source]#

The income_start_mth column, int64 by point: int() of each value, 0 where income_start_mth_ok() is 0.

income_start_mth_ok()[source]#

1 where int() reads the point’s income_start_mth below 2**53 in size, as duration_mth_ok().

frequency()[source]#

The frequency column, int64 by point: int() of each value, 0 where frequency_ok() is 0.

Any whole number is held; Projection.payment_freq refuses one that is not 12, 4, 2 or 1, with DIA_US_S’s message.

frequency_ok()[source]#

1 where int() reads the point’s frequency below 2**53 in size, as duration_mth_ok().

cola_rate()[source]#

The cola_rate column, float64 by point, as model_point_table() checked it, a number zero or more.

issue_year()[source]#

The issue_year column, int64 by point: int() of each value, 0 where issue_year_ok() is 0.

issue_year_ok()[source]#

1 where int() reads the point’s issue_year below 2**53 in size, as duration_mth_ok(). Only the generational basis and the calendar year read it.

purchase_rate_dp()[source]#

The purchase_rate_dp column, int64 by point: -1 where blank, for full precision, as Projection.purchase_rate_dp reads it at stage E, int() of the value elsewhere, and 0 where purchase_rate_dp_ok() is 0.

purchase_rate_dp_ok()[source]#

1 where purchase_rate_dp() holds the point’s value: blank, or below 2**53 in size.

adjust_mth()[source]#

The adjust_mth column, int64 by point: -1 where blank, for never, int() of the value elsewhere, and 0 where adjust_mth_ok() is 0.

adjust_mth_ok()[source]#

1 where adjust_mth() holds the point’s month: blank, or below 2**53 in size.

adjust_start_mth()[source]#

The adjust_start_mth column, int64 by point: -1 where blank, as adjust_mth().

adjust_start_mth_ok()[source]#

1 where adjust_start_mth() holds the point’s month: blank, or below 2**53 in size.

accel_mth()[source]#

The accel_mth column, int64 by point: -1 where blank, as adjust_mth().

accel_mth_ok()[source]#

1 where accel_mth() holds the point’s month: blank, or below 2**53 in size.

commute_mth()[source]#

The commute_mth column, int64 by point: -1 where blank, as adjust_mth().

commute_mth_ok()[source]#

1 where commute_mth() holds the point’s month: blank, or below 2**53 in size.

commute_frac()[source]#

The commute_frac column, float64 by point: 0.0 where blank, for none, as Projection.commute_frac reads it at stage E.

other_qlac_premium()[source]#

The other_qlac_premium column, float64 by point, as model_point_table() checked it.

lives_if_init_1()[source]#

The lives_if_init_1 column, float64 by point: checked by model_point_table().

lives_if_init_2()[source]#

The lives_if_init_2 column, float64 by point: checked by model_point_table().

cum_premium_pp_init()[source]#

The cum_premium_pp_init column, float64 by point: checked by model_point_table().

annual_income_init()[source]#

The annual_income_init column, float64 by point: checked by model_point_table().

guarantee_mths_pricing_init()[source]#

The guarantee_mths_pricing_init column, float64 by point, NaN where blank: given exactly on a refund form in force, as model_point_table() checks, and read only there.

surv_to_payout_init()[source]#

The surv_to_payout_init column, 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_init column, 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_init column, float64 by point: checked by model_point_table().

has_market_type()[source]#

1 where the point’s market_type is one of DIA_US_S’s four, compared exactly.

is_qlac()[source]#

1 where the point’s market_type is QLAC.

has_income_form()[source]#

1 where the point’s income_form is one of DIA_US_S’s five, compared exactly.

is_life_only()[source]#

1 where the point’s income_form is LO or LO_ROP, life only in payout.

is_cash_refund()[source]#

1 where the point’s income_form is CR.

is_installment_refund()[source]#

1 where the point’s income_form is IR.

is_period_certain()[source]#

1 where the point’s income_form is PC.

has_db_form()[source]#

1 where the point’s db_form is ROP or NONE.

is_rop()[source]#

1 where the point’s db_form is ROP.

has_timing()[source]#

1 where the point’s timing is arrears or advance.

is_arrears()[source]#

1 where the point’s timing is arrears.

has_reduction_trigger()[source]#

1 where the point’s reduction_trigger is either or primary.

is_trigger_either()[source]#

1 where the point’s reduction_trigger is either.

has_mort_basis()[source]#

1 where the point’s mort_basis is anchor or generational.

is_generational()[source]#

1 where the point’s mort_basis is generational.

has_factor_basis()[source]#

1 where the point’s factor_basis is table or formula.

is_formula_basis()[source]#

1 where the point’s factor_basis is formula.

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 stage E did, and refuses an age of 2**53 or 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 s is the s-th of the table’s sexes in sorted order, from 1; row 0, and every age below a sex’s first, is NaN padding, which Projection.mort_rate_base_at never reads, since it checks the age against mort_age_first() and mort_age_last() first.

mort_age_first()[source]#

Each mortality schedule’s first age, int64 by schedule: 1 on schedule 0.

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 as DIA_US_S’s .loc matches it, and 0 where the table lacks it, which Projection.mort_rate_base_at refuses where it first reads schedule 0.

mort_schedule_2()[source]#

The mortality schedule of each point’s joint_sex, int64 by point, as mort_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, as mort_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 as mort_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, as mort_schedule_1() by the table’s.

improvement_schedule_2()[source]#

The improvement schedule of each point’s joint_sex, int64 by point, as improvement_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 written 80.0 is 80. Projection.payout_factor scans 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, as payout_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 forms payout_factor_count() admits, which Projection.payout_factor numbers from the decodes.

payout_factor_value()[source]#

payout_factor_table.csv’s payout_factor, float64 by row, as payout_factor_count() checked it.

payout_schedule()[source]#

Each point’s sex in 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, so Projection.payout_factor refuses 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 as rop_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, as rop_schedule() numbers a point’s.

rop_deferral_years()[source]#

rop_factor_table.csv’s deferral_years, int64 by row, read by value as rop_factor_count() checked it.

rop_factor_value()[source]#

rop_factor_table.csv’s rop_factor, float64 by row, as rop_factor_count() checked it.

rop_schedule()[source]#

Each point’s sex in rop_factor_table.csv’s numbering, int64 by point, 0 where the table lacks it, as payout_schedule().

premium_width()[source]#

The width of the premium tables, an int: the schedule’s latest policy month and one, no more than premium_last_mth and 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 from Projection: a test holds the two together.

premium_array()[source]#

Each point’s premiums still due, float64 by point and policy month, [i, k].

The rows of each point of premium_schedule_table() sorted by premium_mth as DIA_US_S’s premium_schedule sorts them, and each amount added in that order to its month’s total from 0.0, as DIA_US_S’s premium_by_mth adds it, so that a month with two rows holds DIA_US_S’s float to the last bit. 0.0 in a month with no row, and on a point with none. A row after premium_width()’s last month is not held: its point’s income starts later than Projection.proj_len admits.

premium_rows()[source]#

The number of rows of each point’s schedule in each policy month, int64 by point and policy month, [i, k], as premium_array() holds them.

DIA_US_S’s premium_by_mth holds a key for every month with a row, a premium of 0.0 among them, and its pricing guarantee visits each, so Projection visits a month with a row, not a month with a positive premium.

premium_last()[source]#

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.