## reserving.CalendarYearTest


Mack's test for calendar-year effects (Mack 1994, appendix H; R


Usage

``` python
reserving.CalendarYearTest()
```


ChainLadder's `cyEffTest`), from [calendar_year_effect](reserving.calendar_year_effect.md#prospicio.reserving.calendar_year_effect) or [MackFit.calendar_year_effect](reserving.MackFit.md#prospicio.reserving.MackFit.calendar_year_effect).

At each age the link ratios are split at their median into small and large ones (one equal to the median is in neither); each calendar diagonal counts its small ones `S_j` and large ones `L_j`, and [z](reserving.CalendarYearTest.md#prospicio.reserving.CalendarYearTest.z), the sum of `min(S_j, L_j)`, is compared with the normal interval `expected ± q sqrt(variance)`, [q](reserving.MunichFit.md#prospicio.reserving.MunichFit.q) the standard normal's `(1 + ci) / 2` quantile. A diagonal where small (or large) factors prevail lowers [z](reserving.CalendarYearTest.md#prospicio.reserving.CalendarYearTest.z).


## Attributes

| Name | Description |
|----|----|
| [ci](#ci) | The interval's confidence level. |
| [diagonals](#diagonals) | Every calendar diagonal with at least two link ratios, oldest |
| [expected](#expected) | `E[Z]` under no calendar-year effect. |
| [lower](#lower) | The interval's lower end. |
| [passes](#passes) | Whether [z](reserving.CalendarYearTest.md#prospicio.reserving.CalendarYearTest.z) lies within the interval (ends included): no |
| [upper](#upper) | The interval's upper end. |
| [variance](#variance) | `Var[Z]` under no calendar-year effect. |
| [z](#z) | `Z`, the sum of each diagonal's `min(S_j, L_j)`. |

------------------------------------------------------------------------


#### ci


The interval's confidence level.


`ci: float`


------------------------------------------------------------------------


#### diagonals


Every calendar diagonal with at least two link ratios, oldest


`diagonals: list[dict]`


first, as a list of dicts with [valuation](reserving.Triangle.md#prospicio.reserving.Triangle.valuation) (the year and month of its later cells, as `"1983-12"`), `small`, `large`, [z](reserving.CalendarYearTest.md#prospicio.reserving.CalendarYearTest.z), [n](pricing.TrendFit.md#prospicio.pricing.TrendFit.n) (`small + large`), `m` (`(n - 1) // 2`), [expected](pricing.Portfolio.md#prospicio.pricing.Portfolio.expected) and [variance](esg.Cir.md#prospicio.esg.Cir.variance): R's `test_table`.


------------------------------------------------------------------------


#### expected


`E[Z]` under no calendar-year effect.


`expected: float`


------------------------------------------------------------------------


#### lower


The interval's lower end.


`lower: float`


------------------------------------------------------------------------


#### passes


Whether [z](reserving.CalendarYearTest.md#prospicio.reserving.CalendarYearTest.z) lies within the interval (ends included): no


`passes: bool`


calendar-year effect is detected. R prints the opposite as "Calendar Year Effect: TRUE".


------------------------------------------------------------------------


#### upper


The interval's upper end.


`upper: float`


------------------------------------------------------------------------


#### variance


`Var[Z]` under no calendar-year effect.


`variance: float`


------------------------------------------------------------------------


#### z


`Z`, the sum of each diagonal's `min(S_j, L_j)`.


`z: float`


## Methods

| Name | Description |
|----|----|
| [to_frame()](#to_frame) | [diagonals](reserving.CalendarYearTest.md#prospicio.reserving.CalendarYearTest.diagonals) as a table, one row per diagonal. Needs pandas. |

------------------------------------------------------------------------


#### to_frame()


[diagonals](reserving.CalendarYearTest.md#prospicio.reserving.CalendarYearTest.diagonals) as a table, one row per diagonal. Needs pandas.


Usage

``` python
to_frame()
```


##### Returns


`pandas.DataFrame`
