The cells of a triangle, for an ODP GLM's design
odp_glm_cells.RdA row per origin and development age of a single-segment triangle,
origin-major: the rows an odp_glm() formula is evaluated on.
Arguments
- triangle
A single-segment triangle of cumulative values.
- column
The column to fit, by default the triangle's only one.
Value
A data frame with origin, development (the age in months)
and calendar as labels; origin_index, development_index and
calendar_index (from 0, the last from the earliest valuation), age
in months and exposure (1) as numbers; and observed and future,
whether the cell is fitted or predicted (a cell after a hole is
neither).
Examples
long <- data.frame(year = c(2020, 2020, 2020, 2021, 2021, 2022),
age = c(12, 24, 36, 12, 24, 12),
paid = c(100, 150, 165, 110, 170, 120))
odp_glm_cells(triangle(long, "year", "age", "paid"))
#> origin development calendar origin_index development_index calendar_index age
#> 1 2020 12 2020 0 0 0 12
#> 2 2020 24 2021 0 1 1 24
#> 3 2020 36 2022 0 2 2 36
#> 4 2021 12 2021 1 0 1 12
#> 5 2021 24 2022 1 1 2 24
#> 6 2021 36 2023 1 2 3 36
#> 7 2022 12 2022 2 0 2 12
#> 8 2022 24 2023 2 1 3 24
#> 9 2022 36 2024 2 2 4 36
#> exposure observed future
#> 1 1 TRUE FALSE
#> 2 1 TRUE FALSE
#> 3 1 TRUE FALSE
#> 4 1 TRUE FALSE
#> 5 1 TRUE FALSE
#> 6 1 FALSE TRUE
#> 7 1 TRUE FALSE
#> 8 1 FALSE TRUE
#> 9 1 FALSE TRUE