diff --git a/chainladder/tails/bondy.py b/chainladder/tails/bondy.py index 11fa6fd4..6886619c 100644 --- a/chainladder/tails/bondy.py +++ b/chainladder/tails/bondy.py @@ -44,6 +44,29 @@ class TailBondy(TailBase): -------- TailCurve + Examples + -------- + Start the Bondy fit later when earlier link ratios are too volatile for the + selected tail. The fitted exponent changes because fewer ages enter the + tail regression. + + .. testsetup:: + + import chainladder as cl + + .. testcode:: + + dev = cl.Development().fit_transform(cl.load_sample("raa")) + b_def = cl.TailBondy().fit(dev) + b_12 = cl.TailBondy(earliest_age=12).fit(dev) + print(round(float(b_def.b_.iloc[0, 0]), 6)) + print(round(float(b_12.b_.iloc[0, 0]), 6)) + + .. testoutput:: + + 0.5 + 0.48451 + """ def __init__(self, earliest_age=None, attachment_age=None, projection_period=12): diff --git a/chainladder/tails/clark.py b/chainladder/tails/clark.py index 052c2e6c..36563962 100644 --- a/chainladder/tails/clark.py +++ b/chainladder/tails/clark.py @@ -45,6 +45,29 @@ class TailClark(TailBase): norm_resid_: Triangle The "Normalized" Residuals of the model according to Clark. + Examples + -------- + Compare Clark growth curves when the selected tail shape is part of the + modeling judgment. The tail LDF changes because each curve extrapolates the + remaining development differently. + + .. testsetup:: + + import chainladder as cl + + .. testcode:: + + dev = cl.Development().fit_transform(cl.load_sample("raa")) + log = cl.TailClark(growth="loglogistic").fit(dev) + wei = cl.TailClark(growth="weibull").fit(dev) + print(round(float(log.ldf_.values[0, 0, 0, -1]), 3)) + print(round(float(wei.ldf_.values[0, 0, 0, -1]), 3)) + + .. testoutput:: + + 1.189 + 1.014 + """ def __init__(self, growth="loglogistic", truncation_age=None, diff --git a/chainladder/tails/curve.py b/chainladder/tails/curve.py index aa89a030..de0fc3c2 100644 --- a/chainladder/tails/curve.py +++ b/chainladder/tails/curve.py @@ -55,6 +55,31 @@ class TailCurve(TailBase): Slope parameter of the curve fit. intercept : DataFrame Intercept parameter of the curve fit. + + Examples + -------- + Compare parametric tail curves when the same development pattern can + support multiple extrapolation shapes. The last-period LDF reflects the + selected curve family. + + .. testsetup:: + + import chainladder as cl + + .. testcode:: + + tri = cl.load_sample("tail_sample") + dev = cl.Development().fit_transform(tri) + exp = cl.TailCurve(curve="exponential", extrap_periods=5).fit(dev) + inv = cl.TailCurve(curve="inverse_power", extrap_periods=5).fit(dev) + print(round(float(exp.ldf_.values[0, 0, 0, -1]), 6)) + print(round(float(inv.ldf_.values[0, 0, 0, -1]), 6)) + + .. testoutput:: + + 1.0093 + 1.039271 + """ def __init__(