reserving.calendar_year_effect()
Mack’s calendar-year effect test (Mack 1994, appendix H; R
Usage
reserving.calendar_year_effect(
triangle,
column,
ci=Ellipsis,
)ChainLadder’s cyEffTest) on every observed link ratio of one column of a single-segment triangle. MackFit.calendar_year_effect tests only the link ratios a fit averaged.
Parameters
triangle: Trianglecolumn: strci: float = 0.95- The interval’s confidence level, Mack’s and R’s 95%.
Returns
CalendarYearTest
Raises
ValueError- If the triangle has several segments or lacks the column, ci is not strictly between 0 and 1, or no calendar diagonal has two link ratios (fewer than three ages).
Examples
>>> from prospicio.reserving import Triangle, calendar_year_effect
>>> paid = [[100.0, 160.0, 180.0, 186.0, 188.0], [110.0, 170.0, 195.0, 200.0],
... [120.0, 200.0, 220.0], [130.0, 205.0], [140.0]]
>>> rows = [(2020 + w, 12 * (d + 1), v) for w, r in enumerate(paid)
... for d, v in enumerate(r)]
>>> origin, age, values = map(list, zip(*rows))
>>> tri = Triangle.from_long(origin, age, {"paid": values})
>>> cy = calendar_year_effect(tri, "paid")
>>> cy.lower <= cy.expected <= cy.upperTrue