## reserving.MackFit


A fitted Mack model of every segment: the chain-ladder fields, plus


Usage


``` python
reserving.MackFit()
```


standard errors of each origin's reserve and of each segment's total.

Per-origin lists run over the origins of each segment in turn, like the rows of [to_frame()](reserving.MackFit.md#prospicio.reserving.MackFit.to_frame). Per-age lists, the tail and the totals' standard errors need a single-segment fit; for several segments use [development_frame()](reserving.MackFit.md#prospicio.reserving.MackFit.development_frame), [totals_frame()](reserving.MackFit.md#prospicio.reserving.MackFit.totals_frame) (the totals' standard errors and the tail) or `segment(...)`. [total_ultimate](reserving.MackFit.md#prospicio.reserving.MackFit.total_ultimate) and [total_reserve](reserving.MackFit.md#prospicio.reserving.MackFit.total_reserve) sum over every segment.


## Attributes

| Name | Description |
|----|----|
| [cdf](#cdf) | Age-to-ultimate factors, including the tail. |
| [chain_ladder](#chain_ladder) | The underlying chain-ladder projection. |
| [development](#development) | Development ages in months. |
| [estimated_ldf](#estimated_ldf) | Factors as estimated, as [ChainLadderFit.estimated_ldf](reserving.ChainLadderFit.md#prospicio.reserving.ChainLadderFit.estimated_ldf). |
| [index](#index) | Label of each segment, as [Triangle.index](reserving.Triangle.md#prospicio.reserving.Triangle.index). |
| [keys](#keys) | Names of the triangle's key columns; empty without keys. |
| [latest](#latest) | Latest observed cumulative value per origin. |
| [ldf](#ldf) | Selected age-to-age factors, as [ChainLadderFit.ldf](reserving.ChainLadderFit.md#prospicio.reserving.ChainLadderFit.ldf). |
| [origins](#origins) | Origin period of each per-origin value. |
| [parameter_risk](#parameter_risk) | Parameter (estimation) standard error per origin. |
| [process_risk](#process_risk) | Process standard error per origin. |
| [reserve](#reserve) | Reserve per origin. |
| [sigma](#sigma) | Variance parameter of each factor. |
| [standard_error](#standard_error) | Mack standard error per origin: `sqrt(process**2 + parameter**2)`. |
| [std_err](#std_err) | Standard error of each factor. |
| [tail](#tail) | Tail factor from the oldest age to ultimate. |
| [tail_attachment_age](#tail_attachment_age) | Age from which [ldf](reserving.MackFit.md#prospicio.reserving.MackFit.ldf) holds the tail's factors, as |
| [tail_ldf](#tail_ldf) | Factors past the oldest age, as [ChainLadderFit.tail_ldf](reserving.ChainLadderFit.md#prospicio.reserving.ChainLadderFit.tail_ldf). |
| [tail_sigma](#tail_sigma) | The tail's sigma used in the process risk: given, or extrapolated |
| [tail_std_err](#tail_std_err) | The tail factor's standard error used in the parameter risk: given, |
| [total_cv](#total_cv) | Coefficient of variation of the total reserve. |
| [total_parameter_risk](#total_parameter_risk) | Parameter standard error of the total reserve, including the |
| [total_process_risk](#total_process_risk) | Process standard error of the total reserve. |
| [total_reserve](#total_reserve) | Total reserve across segments and origins. |
| [total_standard_error](#total_standard_error) | Mack standard error of the total reserve. |
| [total_ultimate](#total_ultimate) | Total ultimate across segments and origins. |
| [ultimate](#ultimate) | Projected ultimate per origin. |

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


#### cdf


Age-to-ultimate factors, including the tail.


`cdf: list[float]`


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


#### chain_ladder


The underlying chain-ladder projection.


`chain_ladder: ChainLadderFit`


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


#### development


Development ages in months.


`development: list[int]`


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


#### estimated_ldf


Factors as estimated, as [ChainLadderFit.estimated_ldf](reserving.ChainLadderFit.md#prospicio.reserving.ChainLadderFit.estimated_ldf).


`estimated_ldf: list[float]`


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


#### index


Label of each segment, as [Triangle.index](reserving.Triangle.md#prospicio.reserving.Triangle.index).


`index: list[Any]`


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


#### keys


Names of the triangle's key columns; empty without keys.


`keys: list[str]`


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


#### latest


Latest observed cumulative value per origin.


`latest: list[float]`


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


#### ldf


Selected age-to-age factors, as [ChainLadderFit.ldf](reserving.ChainLadderFit.md#prospicio.reserving.ChainLadderFit.ldf).


`ldf: list[float]`


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


#### origins


Origin period of each per-origin value.


`origins: list[str]`


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


#### parameter_risk


Parameter (estimation) standard error per origin.


`parameter_risk: list[float]`


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


#### process_risk


Process standard error per origin.


`process_risk: list[float]`


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


#### reserve


Reserve per origin.


`reserve: list[float]`


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


#### sigma


Variance parameter of each factor.


`sigma: list[float]`


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


#### standard_error


Mack standard error per origin: `sqrt(process**2 + parameter**2)`.


`standard_error: list[float]`


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


#### std_err


Standard error of each factor.


`std_err: list[float]`


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


#### tail


Tail factor from the oldest age to ultimate.


`tail: float`


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


#### tail_attachment_age


Age from which [ldf](reserving.MackFit.md#prospicio.reserving.MackFit.ldf) holds the tail's factors, as


`tail_attachment_age: int`


[ChainLadderFit.tail_attachment_age](reserving.ChainLadderFit.md#prospicio.reserving.ChainLadderFit.tail_attachment_age).


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


#### tail_ldf


Factors past the oldest age, as [ChainLadderFit.tail_ldf](reserving.ChainLadderFit.md#prospicio.reserving.ChainLadderFit.tail_ldf).


`tail_ldf: list[float]`


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


#### tail_sigma


The tail's sigma used in the process risk: given, or extrapolated


`tail_sigma: float`


log-linearly; 0 without a tail (a factor of 1).


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


#### tail_std_err


The tail factor's standard error used in the parameter risk: given,


`tail_std_err: float`


or extrapolated log-linearly; 0 without a tail (a factor of 1).


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


#### total_cv


Coefficient of variation of the total reserve.


`total_cv: float`


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


#### total_parameter_risk


Parameter standard error of the total reserve, including the


`total_parameter_risk: float`


correlation between origins that share estimated factors.


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


#### total_process_risk


Process standard error of the total reserve.


`total_process_risk: float`


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


#### total_reserve


Total reserve across segments and origins.


`total_reserve: float`


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


#### total_standard_error


Mack standard error of the total reserve.


`total_standard_error: float`


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


#### total_ultimate


Total ultimate across segments and origins.


`total_ultimate: float`


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


#### ultimate


Projected ultimate per origin.


`ultimate: list[float]`


## Methods

| Name | Description |
|----|----|
| [claims_development_result()](#claims_development_result) | Merz and Wüthrich's (2008) one-year view: the standard error of the |
| [development_frame()](#development_frame) | One row per segment and age, as [ChainLadderFit.development_frame](reserving.ChainLadderFit.md#prospicio.reserving.ChainLadderFit.development_frame). |
| [segment()](#segment) | The fit of one segment, chosen by key values as |
| [to_frame()](#to_frame) | One row per segment and origin: the key columns, `origin`, |
| [totals_frame()](#totals_frame) | One row per segment: the key columns, the segment's total |

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


#### claims_development_result()


Merz and Wüthrich's (2008) one-year view: the standard error of the


Usage


``` python
claims_development_result()
```


claims development result of each origin and in total, in the next calendar year and in every later one, as R ChainLadder's `CDR(MackChainLadder(x), dev = "all")`.


##### Returns


`ClaimsDevelopmentResult`  


##### Raises


`ValueError`  
If the fit has several segments (use `segment(...)`), the factors are not volume-weighted, the fit has a tail (a factor other than 1, or one that replaces estimated factors), or the latest values do not lie on one calendar diagonal with one new origin per period.


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


#### development_frame()


One row per segment and age, as [ChainLadderFit.development_frame](reserving.ChainLadderFit.md#prospicio.reserving.ChainLadderFit.development_frame).


Usage


``` python
development_frame()
```


Needs pandas.


##### Returns


`pandas.DataFrame`  


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


#### segment()


The fit of one segment, chosen by key values as


Usage


``` python
segment(**keys)
```


[ChainLadderFit.segment](reserving.ChainLadderFit.md#prospicio.reserving.ChainLadderFit.segment).


##### Returns


`MackFit`  


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


#### to_frame()


One row per segment and origin: the key columns, `origin`,


Usage


``` python
to_frame()
```


[latest](reserving.MackFit.md#prospicio.reserving.MackFit.latest), [ultimate](reserving.MackFit.md#prospicio.reserving.MackFit.ultimate), [reserve](reserving.MackFit.md#prospicio.reserving.MackFit.reserve), [process_risk](reserving.MackFit.md#prospicio.reserving.MackFit.process_risk), [parameter_risk](reserving.MackFit.md#prospicio.reserving.MackFit.parameter_risk) and [standard_error](reserving.MackFit.md#prospicio.reserving.MackFit.standard_error). Needs pandas.


##### Returns


`pandas.DataFrame`  


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


#### totals_frame()


One row per segment: the key columns, the segment's total


Usage


``` python
totals_frame()
```


[latest](reserving.MackFit.md#prospicio.reserving.MackFit.latest), [ultimate](reserving.MackFit.md#prospicio.reserving.MackFit.ultimate) and [reserve](reserving.MackFit.md#prospicio.reserving.MackFit.reserve), and the [process_risk](reserving.MackFit.md#prospicio.reserving.MackFit.process_risk), [parameter_risk](reserving.MackFit.md#prospicio.reserving.MackFit.parameter_risk) and [standard_error](reserving.MackFit.md#prospicio.reserving.MackFit.standard_error) of its total reserve. Needs pandas.


##### Returns


`pandas.DataFrame`
