SplitExposedDF

expose_split.SplitExposedDF(self, expo)

Split calendar exposures by policy year

Split calendar period exposures that cross a policy anniversary into a pre-anniversary record and a post-anniversary record.

Parameters

Name Type Description Default
expo actxps.ExposedDF An exposure data frame class with calendar-based exposure periods required

Notes

The ExposedDF must have calendar year, quarter, month, or week exposure records. Calendar year exposures are created by passing cal_expo=True to ExposedDF (or alternatively, with the class methods ExposedDF.expose_cy(), ExposedDF.expose_cq(), ExposedDF.expose_cm(), and ExposedDF.expose_cw()).

After splitting, the resulting data will contain both calendar exposures and policy year exposures. These columns will be named ‘exposure_cal’ and ‘exposure_pol’, respectively. Calendar exposures will be in the original units passed to SplitExposedDF(). Policy exposures will always be expressed in years. Downstream functions like exp_stats() and exp_shiny() will require clarification as to which exposure basis should be used to summarize results.

After splitting, the column ‘pol_yr’ will contain policy years.

Examples

import actxps as xp
toy_census = xp.load_toy_census()
expo = xp.ExposedDF.expose_cy(toy_census, "2022-12-31")
xp.SplitExposedDF(expo)
Exposure data

Exposure type: split_year
Target status: None
Study range: 1900-01-01 to 2022-12-31

shape: (58, 9)
┌─────────┬───────────┬────────────┬────────────┬───┬────────────┬────────┬────────────┬───────────┐
│ pol_num ┆ status    ┆ issue_date ┆ term_date  ┆ … ┆ cal_yr_end ┆ pol_yr ┆ exposure_p ┆ exposure_ │
│ ---     ┆ ---       ┆ ---        ┆ ---        ┆   ┆ ---        ┆ ---    ┆ ol         ┆ cal       │
│ i64     ┆ enum      ┆ date       ┆ date       ┆   ┆ date       ┆ i32    ┆ ---        ┆ ---       │
│         ┆           ┆            ┆            ┆   ┆            ┆        ┆ f64        ┆ f64       │
╞═════════╪═══════════╪════════════╪════════════╪═══╪════════════╪════════╪════════════╪═══════════╡
│ 1       ┆ Active    ┆ 2010-01-01 ┆ null       ┆ … ┆ 2010-12-31 ┆ 1      ┆ 1.0        ┆ 1.0       │
│ 1       ┆ Active    ┆ 2010-01-01 ┆ null       ┆ … ┆ 2011-12-31 ┆ 2      ┆ 1.0        ┆ 1.0       │
│ 1       ┆ Active    ┆ 2010-01-01 ┆ null       ┆ … ┆ 2012-12-31 ┆ 3      ┆ 1.0        ┆ 1.0       │
│ 1       ┆ Active    ┆ 2010-01-01 ┆ null       ┆ … ┆ 2013-12-31 ┆ 4      ┆ 1.0        ┆ 1.0       │
│ 1       ┆ Active    ┆ 2010-01-01 ┆ null       ┆ … ┆ 2014-12-31 ┆ 5      ┆ 1.0        ┆ 1.0       │
│ …       ┆ …         ┆ …          ┆ …          ┆ … ┆ …          ┆ …      ┆ …          ┆ …         │
│ 3       ┆ Active    ┆ 2009-11-10 ┆ null       ┆ … ┆ 2020-11-09 ┆ 11     ┆ 0.857923   ┆ 0.857923  │
│ 3       ┆ Active    ┆ 2009-11-10 ┆ null       ┆ … ┆ 2020-12-31 ┆ 12     ┆ 0.142466   ┆ 0.142077  │
│ 3       ┆ Active    ┆ 2009-11-10 ┆ null       ┆ … ┆ 2021-11-09 ┆ 12     ┆ 0.857534   ┆ 0.857534  │
│ 3       ┆ Active    ┆ 2009-11-10 ┆ null       ┆ … ┆ 2021-12-31 ┆ 13     ┆ 0.142466   ┆ 0.142466  │
│ 3       ┆ Surrender ┆ 2009-11-10 ┆ 2022-02-25 ┆ … ┆ 2022-11-09 ┆ 13     ┆ 0.153425   ┆ 0.153425  │
└─────────┴───────────┴────────────┴────────────┴───┴────────────┴────────┴────────────┴───────────┘

See Also

ExposedDF() for more information on exposure data.