reserving.ApcGlmFit
A fitted APC GLM, from ApcGlm.fit.
Usage
reserving.ApcGlmFit()Each effect’s periods are indexed from 0; the second difference at l (l = 2..k - 1) is the change in the effect’s slope at period l.
Attributes
effects: str-
"APC","AP","AC"or"PC". extrapolation: str-
"I0","I1"or"I2". origins: list of strages: list of int-
The development ages in months; the columns of fitted follow them.
level: float-
The log mean of the first origin’s first age.
age_slope: float-
The step in the log mean from age 0 to age 1, at origin 0.
accident_slope: float-
The step in the log mean from accident 0 to accident 1, at age 0.
age_second_differences: list of float-
The development effect’s second differences,
l = 2..k - 1; empty without a development effect. accident_second_differences: list of float-
The accident effect’s second differences; empty without it.
calendar_second_differences: list of float-
The calendar effect’s fitted second differences; empty without it.
future_calendar_second_differences: list of float-
The two extrapolated calendar second differences, at
l = kandl = k + 1(all later ones are 0); zeros for"I2"and without a calendar effect. fitted: list of list of float-
The fitted mean of each observed cell, one row per origin,
Nonebelow the latest diagonal. deviance: float-
The GLM’s deviance on the observed cells.
reserves: list of float-
The sum of each origin’s future means; the first origin’s is 0 (no tail past the oldest age).
total_reserve: floatcoefficients: list of float-
The canonical coefficients, in the order of names.
names: list of str-
level,
slope_age,slope_accident, thendd_age[l],dd_accident[l]anddd_calendar[l]for the effects in the model. covariance: list of list of float-
The coefficients’ covariance, as a list of rows.
dispersion: float-
Pearson’s dispersion phi.
future: FutureCells-
The future cells’ means.
odp_fit: OdpGlmFit-
The GLM on the canonical design, with residuals, predict_distribution and the rest of
OdpGlmFit.
Attributes
| Name | Description |
|---|---|
| accident_second_differences | The accident effect’s second differences; empty without it. |
| accident_slope | The step in the log mean from accident 0 to accident 1, at age 0. |
| age_second_differences |
The development effect’s second differences, l = 2..k - 1; empty without it.
|
| age_slope | The step in the log mean from age 0 to age 1, at origin 0. |
| ages | The development ages in months; the columns of fitted follow them. |
| calendar_second_differences | The calendar effect’s fitted second differences; empty without it. |
| coefficients | The canonical coefficients, in the order of names. |
| covariance | The coefficients’ covariance, as a list of rows. |
| deviance | The GLM’s deviance on the observed cells. |
| dispersion | Pearson’s dispersion phi. |
| effects |
"APC", "AP", "AC" or "PC".
|
| extrapolation |
"I0", "I1" or "I2": the rule used for the future cells.
|
| fitted |
The fitted mean of each observed cell, None below the latest diagonal.
|
| future | The future cells’ means, as FutureCells. |
| future_calendar_second_differences |
The two extrapolated calendar second differences, at l = k and l = k + 1.
|
| level | The log mean of the first origin’s first age. |
| names | The canonical coefficients’ names. |
| odp_fit |
The GLM on the canonical design, as OdpGlmFit: residuals,
|
| origins | The origin periods; fitted and reserves follow them. |
| reserves | The sum of each origin’s future means; the first origin’s is 0. |
| total_reserve | The total reserve. |
accident_second_differences
The accident effect’s second differences; empty without it.
accident_second_differences: list[float]
accident_slope
The step in the log mean from accident 0 to accident 1, at age 0.
accident_slope: float
age_second_differences
The development effect’s second differences, l = 2..k - 1; empty without it.
age_second_differences: list[float]
age_slope
The step in the log mean from age 0 to age 1, at origin 0.
age_slope: float
ages
The development ages in months; the columns of fitted follow them.
ages: list[int]
calendar_second_differences
The calendar effect’s fitted second differences; empty without it.
calendar_second_differences: list[float]
coefficients
The canonical coefficients, in the order of names.
coefficients: list[float]
covariance
The coefficients’ covariance, as a list of rows.
covariance: list[list[float]]
deviance
The GLM’s deviance on the observed cells.
deviance: float
dispersion
Pearson’s dispersion phi.
dispersion: float
effects
"APC", "AP", "AC" or "PC".
effects: str
extrapolation
"I0", "I1" or "I2": the rule used for the future cells.
extrapolation: str
fitted
The fitted mean of each observed cell, None below the latest diagonal.
fitted: list[list[float | None]]
future
The future cells’ means, as FutureCells.
future: FutureCells
future_calendar_second_differences
The two extrapolated calendar second differences, at l = k and l = k + 1.
future_calendar_second_differences: list[float]
level
The log mean of the first origin’s first age.
level: float
names
The canonical coefficients’ names.
names: list[str]
odp_fit
The GLM on the canonical design, as OdpGlmFit: residuals,
odp_fit: OdpGlmFit
predict_distribution and the future design.
origins
origins: list[str]
reserves
The sum of each origin’s future means; the first origin’s is 0.
reserves: list[float]
total_reserve
The total reserve.
total_reserve: float
Methods
| Name | Description |
|---|---|
| predict_distribution() | Joint draws of the future cells’ increments, as |
| prediction_error() | The reserves’ prediction error by origin and in total, as |
predict_distribution()
Joint draws of the future cells’ increments, as
Usage
predict_distribution(n_sims, seed, parameters="mean_preserving")OdpGlmFit.predict_distribution: the same draws as fit.odp_fit.predict_distribution for the same arguments.
Parameters
n_sims: intseed: intparameters: (mean_preserving, normal, fixed) = "mean_preserving"-
How the coefficients are drawn, as
OdpGlmFit’s.
Returns
PredictiveDistribution
Raises
ValueError- If n_sims is 0 or parameters is unknown.
prediction_error()
The reserves’ prediction error by origin and in total, as
Usage
prediction_error()OdpGlmFit.prediction_error: the process error and the parameter error by the delta method. The extrapolated calendar effect is a fixed linear function of the fitted second differences, so its uncertainty is included.