MunichAdjustment#

class chainladder.MunichAdjustment(paid_to_incurred=None, fillna=False)[source]#
Applies the Munich Chainladder adjustment to a set of paid/incurred

ldfs. The Munich method heavily relies on the ratio of paid/incurred and its inverse.

Parameters:
paid_to_incurred: tuple or list of tuples

A tuple representing the paid and incurred columns of the triangles such as ('paid', 'incurred')

fillna: boolean

The MunichAdjustment will fail when P/I or I/P ratios cannot be calculated. Setting fillna to True will fill the triangle with expected amounts using the simple chainladder.

Attributes:
basic_cdf_: Triangle

The univariate cumulative development patterns

basic_sigma_: Triangle

Sigma of the univariate ldf regression

resids_: Triangle

Residuals of the univariate ldf regression

q_: Triangle

chainladder age-to-age factors of the paid/incurred triangle and its inverse. For paid measures it is (P/I) and for incurred measures it is (I/P).

q_resids_: Triangle

Residuals of q regression.

rho_: Triangle

Estimated conditional deviation around q_

lambda_: Series or DataFrame

Dependency coefficient between univariate chainladder link ratios and q_resids_

ldf_: Triangle

The estimated bivariate loss development patterns

cdf_: Triangle

The estimated bivariate cumulative development patterns

Examples

fillna=True imputes missing paid/incurred amounts with simple chainladder expectations so the bivariate regression can still run.

mcl = cl.load_sample("mcl").copy()
arr = np.asarray(mcl.values, dtype=float, copy=True)
arr[0, 1, 0, 2] = np.nan
mcl.values = arr
dev = cl.Development().fit_transform(mcl)
try:
    cl.MunichAdjustment(("paid", "incurred"), fillna=False).fit(dev)
    print("no_error")
except ValueError:
    print("ValueError")
filled = cl.MunichAdjustment(("paid", "incurred"), fillna=True).fit(dev)
print(round(float(filled.ldf_.values[0, 0, 0, 0]), 6))
ValueError
2.151329
fit(X, y=None, sample_weight=None)[source]#

Fit the model with X.

Parameters:
XTriangle-like

Set of LDFs to which the munich adjustment will be applied.

yIgnored
sample_weightIgnored
Returns:
selfobject

Returns the instance itself.

transform(X)[source]#

If X and self are of different shapes, align self to X, else return self.

Parameters:
XTriangle

The triangle to be transformed

Returns:
X_newNew triangle with transformed attributes.

Inherited Methods

MunichAdjustment.fit_transform

Fit to data, then transform it.

MunichAdjustment.get_metadata_routing

Get metadata routing of this object.

MunichAdjustment.get_params

Get parameters for this estimator.

MunichAdjustment.pipe

Apply func(self, *args, **kwargs).

MunichAdjustment.set_backend

Converts triangle array_backend.

MunichAdjustment.set_output

Set output container.

MunichAdjustment.set_params

Set the parameters of this estimator.

MunichAdjustment.to_json

Serializes triangle object to json format

MunichAdjustment.to_pickle

Serializes triangle object to pickle.