chainladder.Benktander

Contents

chainladder.Benktander#

class chainladder.Benktander(apriori=1.0, n_iters=1, apriori_sigma=0, random_state=None)[source]#

The Benktander (or iterated Bornhuetter-Ferguson) IBNR model

Parameters:
apriori: float, optional (default=1.0)

Multiplier for the sample_weight used in the Benktander method method. If sample_weight is already an apriori measure of ultimate, then use 1.0

n_iters: int, optional (default=1)

Number of iterations to use in the Benktander model. When n_iters=1, the result is equivalent to the BornhuetterFerguson method. When n_iters>>1, the result converges to the traditional Chainladder model.

apriori_sigma: float, optional (default=0.0)

Standard deviation of the apriori. When used in conjunction with the bootstrap model, the model samples aprioris from a lognormal distribution using this argument as a standard deviation.

random_state: int, RandomState instance or None, optional (default=None)

Seed for sampling from the apriori distribution. This is ignored when using as a deterministic method. If int, random_state is the seed used by the random number generator; If RandomState instance, random_state is the random number generator; If None, the random number generator is the RandomState instance used by np.random.

Attributes:
ultimate_: Triangle

The ultimate losses per the method

ibnr_: Triangle

The IBNR per the method

Methods

fit(X[, y, sample_weight])

Applies the Benktander technique to triangle X

get_metadata_routing()

Get metadata routing of this object.

get_params([deep])

Get parameters for this estimator.

intersection(a, b)

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

predict(X[, sample_weight])

Predicts the Benktander ultimate on a new triangle X

set_backend(backend[, inplace, deep])

Converts triangle array_backend.

set_fit_request(*[, sample_weight])

Configure whether metadata should be requested to be passed to the fit method.

set_params(**params)

Set the parameters of this estimator.

set_predict_request(*[, sample_weight])

Configure whether metadata should be requested to be passed to the predict method.

to_json()

Serializes triangle object to json format

to_pickle(path[, protocol])

Serializes triangle object to pickle.

fit_predict

pipe

validate_X

validate_weight

Examples

Benktander is the iterated Bornhuetter-Ferguson model. Like BF, it requires a per-origin apriori expected ultimate supplied through sample_weight. The n_iters parameter interpolates between BF (n_iters=1) and chainladder (n_iters large): each additional iteration shifts the ultimate further toward the chainladder estimate.

xyz = cl.load_sample("xyz")

ibnr = cl.Benktander().fit(X=xyz["Paid"], sample_weight=xyz["Premium"].latest_diagonal).ibnr_
print(ibnr)
              2261
1998           NaN
1999    115.472127
2000    914.033812
2001   2432.394513
2002   6037.026677
2003  13928.934651
2004  33925.451475
2005  69724.761575
2006  73410.593920
2007  52977.560411
2008  45873.769490

When n_iters=1, the model is exactly the same as the BornhuetterFerguson model.

xyz = cl.load_sample("xyz")

bk_ibnr = (
    cl.Benktander(n_iters=1)
    .fit(X=xyz["Paid"], sample_weight=xyz["Premium"].latest_diagonal)
    .ibnr_
)
bf_ibnr = (
    cl.BornhuetterFerguson()
    .fit(X=xyz["Paid"], sample_weight=xyz["Premium"].latest_diagonal)
    .ibnr_
)
print(bk_ibnr - bf_ibnr)
      2261
1998   NaN
1999   NaN
2000   NaN
2001   NaN
2002   NaN
2003   NaN
2004   NaN
2005   NaN
2006   NaN
2007   NaN
2008   NaN

When n_iters>>1, the model converges to the traditional Chainladder model.

xyz = cl.load_sample("xyz")

bk_ibnr = cl.Benktander(n_iters=1000).fit(X=xyz["Paid"], sample_weight=xyz["Premium"].latest_diagonal).ibnr_
cl_ibnr = cl.Chainladder().fit(xyz["Paid"]).ibnr_
print(bk_ibnr - cl_ibnr)
              2261
1998           NaN
1999           NaN
2000           NaN
2001  1.455192e-11
2002 -7.275958e-12
2003  7.275958e-12
2004  1.455192e-11
2005 -1.455192e-11
2006  2.910383e-11
2007 -5.820766e-11
2008 -7.275958e-11