R/synthetic-fcip-core.R
identify_cause_of_loss.RdThe general attribution primitive: for every insured unit, determines which
peril(s) caused its indemnity by matching Summary of Business unit
experience to cause-of-loss records (see the cascade described under
identify_pp_units(), which is the prevented-planting specialization of
this function). Any column of the cause-of-loss records can serve as the
taxonomy (cause_var), e.g. damage_name_recode, damage_cause_code, or
stage_code.
Unit-level Summary of Business (modern rfcip names).
Cause-of-loss records matched to the Summary of Business.
Stage-code listing (stage_code,
stage_code_description); joined for completeness of the taxonomy.
Optional table (e.g. a provision's actuarial records) whose identifier columns restrict both sides to covered pools.
Column of colsom defining the cause taxonomy.
Insurance plan codes retained.
Drop catastrophic coverage.
Prorate unresolved pools by residual indemnity shares.
Interact the taxonomy with the loss type: each cause
becomes <cause>|pp (Prevented stages) or <cause>|prod (all other
stages), and buyup_shares is returned.
Regular expression identifying prevented-planting
stages in stage_code_description (used when split_pp).
Named character vector mapping buy-up stage codes to
election labels ("05", "10"); used when split_pp.
A list of data.tables keyed by unit_uid (internal to one
call; ship the set together):
the filtered sobtpu rows plus unit_uid, col_status,
col_status_label, primary_cause, primary_cause_share
long unit_uid x cause: share_indem (the
unit's indemnity share by cause; matched shares for resolved units,
pool prorate for unresolved) and share_acres (pool-level share of
determined acres by cause). Shares sum to one within a unit.
when split_pp, long unit_uid x buyup
("05"/"10"): the unit's indemnity share in buy-up Prevented stages
(same resolution logic as cause_shares); nests inside the
|pp cause shares, so basic PP is recoverable by subtraction.
NULL otherwise.
Other synthetic-fcip-core:
assign_ri_grids(),
attach_peril_probabilities(),
build_agent_panel(),
build_peril_probabilities(),
col_status_labels,
identify_pp_units(),
pp_status_labels