MackChainladder#

class chainladder.MackChainladder[source]#

Basic stochastic chainladder method popularized by Thomas Mack

Parameters:
None
Attributes:
X_:

returns X

ultimate_:

The ultimate losses per the method

ibnr_:

The IBNR per the method

full_expectation_:

The ultimates back-filled to each development period in X replacing the known data

full_triangle_:

The ultimates back-filled to each development period in X retaining the known data

summary_:

summary of the model

full_std_err_:

The full standard error

total_process_risk_:

The total process error

total_parameter_risk_:

The total parameter error

mack_std_err_:

The total prediction error by origin period

total_mack_std_err_:

The total prediction error across all origin periods

Examples

Fit the Mack chainladder method and inspect the headline summary table, which combines the deterministic chainladder estimate with Mack’s stochastic standard error.

The deterministic chainladder ultimates match those of Chainladder. Mack’s contribution is the stochastic standard error in the rightmost column, which can be aggregated across origins.

fit(X, y=None, sample_weight=None)[source]#

Fit the model with X.

Parameters:
X: Triangle-like

Data to which the model will be applied.

y: Ignored
sample_weight: Ignored
Returns:
self: object

Returns the instance itself.

Examples

Fitting attaches the ultimate_ and Mack std error attributes to the estimator and returns the estimator itself.

tr = cl.load_sample('ukmotor')
cl.MackChainladder().fit(tr)
MackChainladder()
predict(X, sample_weight=None)[source]#

Predicts the Mack chainladder ultimate on a new triangle X.

The fitted age-to-age factors and sigma estimates from self.X_ are applied to X to compute ultimate_ and the Mack standard errors (parameter risk, process risk, mack_std_err_, total_mack_std_err_) on the predicted Triangle.

Parameters:
X: Triangle

Loss data to which the fitted model will be applied. Must share the same shape as the Triangle used in fit().

sample_weight: Triangle

Optional exposure used in CDF alignment.

Returns:
X_new: Triangle

Triangle with ultimate_ and Mack std error attributes attached.

Examples

Fit the model and apply it to a Triangle with the same shape, then read the Mack standard error off the resulting Triangle.

tr = cl.load_sample('ukmotor')
model = cl.MackChainladder().fit(tr)
predicted = model.predict(tr)
print(predicted.total_mack_std_err_)
columns        values
(Total,)  1424.531543

Inherited Methods

MackChainladder.fit_predict

MackChainladder.get_metadata_routing

Get metadata routing of this object.

MackChainladder.get_params

Get parameters for this estimator.

MackChainladder.intersection

Given two Triangles with mismatched indices, this method aligns their indices

MackChainladder.pipe

MackChainladder.set_backend

Converts triangle array_backend.

MackChainladder.set_params

Set the parameters of this estimator.

MackChainladder.to_json

Serializes triangle object to json format

MackChainladder.to_pickle

Serializes triangle object to pickle.

MackChainladder.validate_X

MackChainladder.validate_weight