BornhuetterFerguson#
- class chainladder.BornhuetterFerguson(apriori=1.0, apriori_sigma=0.0, random_state=None)[source]#
The deterministic Bornhuetter Ferguson IBNR model
- Parameters:
- apriori: float, optional (default=1.0)
Multiplier for the sample_weight used in the Bornhuetter Ferguson method. If sample_weight is already an apriori measure of ultimate, then use 1.0. The recommended pratice is to seperate the model parameter assumption and data apart. For example, if the apriori s 80% of premium, it is recommended to set the aprior as 0.8 and leave the premium data in sample_weight argument unmodified.
- 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
Examples
Bornhuetter-Ferguson requires an apriori expected ultimate per origin, supplied through
sample_weight.A common idiom for building a flat per-origin apriori is to take any same-shape Triangle, zero it out, and add the desired value. Here is an example.
raa = cl.load_sample("raa") premium = raa.latest_diagonal * 0 + 40_000 # zero out and add 40,000 to each origin ibnr = cl.BornhuetterFerguson(apriori=0.7).fit(X=raa, sample_weight=premium).ibnr_ print(ibnr)
2261 1981 NaN 1982 255.707763 1983 717.772687 1984 1596.061515 1985 2658.738155 1986 5239.441491 1987 8574.335344 1988 12714.889984 1989 18585.219714 1990 24861.068855
One might be tempted to set never set the aprior and modify the sample_weight directly, and they will result in the same answer, but this is not the recommended practice. It not only add confusion, but it alos mixes the model parameter assumption and data together.
raa = cl.load_sample("raa") premium = raa.latest_diagonal * 0 + 40_000 * 0.7 # premium is modified by 70% ibnr = cl.BornhuetterFerguson().fit(X=raa, sample_weight=premium).ibnr_ print(ibnr)
2261 1981 NaN 1982 255.707763 1983 717.772687 1984 1596.061515 1985 2658.738155 1986 5239.441491 1987 8574.335344 1988 12714.889984 1989 18585.219714 1990 24861.068855
- fit(X, y=None, sample_weight=None)[source]#
Applies the Bornhuetter-Ferguson technique to triangle X
- Parameters:
- XTriangle
Loss data to which the model will be applied.
- yNone
Ignored
- sample_weightTriangle
Required exposure to be used in the calculation.
- Returns:
- selfobject
Returns the instance itself.
Examples
Fit returns the estimator itself, with
ultimate_populated.tr = cl.load_sample('ukmotor') apriori = cl.Chainladder().fit(tr).ultimate_ * 0 + 14000 print(cl.BornhuetterFerguson(apriori=1.0).fit(tr, sample_weight=apriori))
BornhuetterFerguson()
- predict(X, sample_weight=None)[source]#
Predicts the Bornhuetter-Ferguson ultimate on a new triangle X
- Parameters:
- XTriangle
Loss data to which the model will be applied.
- sample_weightTriangle
Required exposure to be used in the calculation.
- Returns:
- X_new: Triangle
Loss data with Bornhuetter-Ferguson ultimate applied
Examples
Fit on a prior-period view of the data, then apply the model to the current Triangle and a refreshed apriori.
tr = cl.load_sample('ukmotor') tr_prior = tr[tr.valuation < tr.valuation_date] apriori_prior = cl.Chainladder().fit(tr_prior).ultimate_ * 0 + 14000 apriori = cl.Chainladder().fit(tr).ultimate_ * 0 + 14000 model = cl.BornhuetterFerguson(apriori=1.0).fit( tr_prior, sample_weight=apriori_prior ) print(model.predict(tr, sample_weight=apriori).ultimate_)
Inherited Methods
|
|
|
Get metadata routing of this object. |
|
Get parameters for this estimator. |
|
Given two Triangles with mismatched indices, this method aligns their indices |
|
|
|
Converts triangle array_backend. |
|
Set the parameters of this estimator. |
|
Serializes triangle object to json format |
|
Serializes triangle object to pickle. |
|
|
|