You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] Development(drop=...) can remove every link ratio at an age, and Chainladder then uses a factor of 1 without a warning #1661
preserve keeps at least one link ratio for drop_high, drop_low, drop_above and drop_below, and it warns when it overrides them. The order of operations in the Development docstring leaves drop and drop_valuation outside preserve, which makes sense for an explicit choice. When that choice removes the only ratio at an age, the fit gives a NaN ldf_ for that age and no warning. cdf_ then treats the missing factor as 1.
On genins, 108-120 has one link ratio, from 2001. Dropping it moves total IBNR from 18,680,856 to 17,825,076.
On main at a59efc9 with -W error::UserWarning, this prints
nan
1.0
5339085.0
17825076
5339085.0
The 2002 ultimate equals its latest diagonal, so the model applies no development past 108. drop_valuation="2009" gives the same NaN ldf_. Every origin from 2002 onward loses the 1.0177 factor, and the 855,780 drop in IBNR is the result.
A user who drops a ratio by hand may want this, but the fit should say that an age has no ratios left. A UserWarning naming the age would match the message preserve already gives, for example "No link ratios remain at ['108-120'] after drop and drop_valuation. Its ldf_ is NaN and cdf_ treats it as 1." Raising an error is the other option if you think a fit with an empty age should not go through.
#1658 hit this while looping leave-one-out refits over every link ratio. Which behavior would you prefer?
(This issue was written with Árbol, an AI assistant, under my direction.)
drop and drop_valuation intentionally don't warn. we assume that the user has examined the underlying triangle and are consciously making the decision to drop.
drop_hi/lo and drop_above/below are more generic parameters that may be on the default pipeline in a reserving workflow. it used to warn whenever preserve is triggered. we've since tightened it to not warn when preserve is triggered by the natural shape of the triangle, i.e. the tail of the triangle.
so the issue comes down to, are there scenarios where the user is intentionally using drop and drop_valuation but should be warned.
for drop_valuation, this only happens if it's the latest valuation. the user should already know that they are dropping off the latest valuation. warning is not needed
for drop, this only happens if the user specifically supplies the last development period in the drop parameter. they likely already have a tail estimator attaching at one development period prior. warning is likely not needed
on the whole, i think a warning would be redundant. we can clarify the warning behavior in the docstring.
Thanks, that makes sense for a user who attaches a tail at the dropped age. I checked it on genins with drop=("2001", 108) on main at cc3335c.
ldf_ 108-120 cdf_ 108-Ult ibnr_.sum()
no drop, no tail 1.017725 1.017725 18680855.61
drop, no tail nan 1.000000 17825075.70
drop, TailConstant(1.05) nan 1.050000 20434233.98
drop, TailCurve() nan 1.033145 19554683.91
drop, TailCurve(attachment_age=108) 1.021915 1.055787 20647872.63
TailCurve(attachment_age=108) fills the dropped age, as you describe. A tail that attaches after the last age leaves 108-120 as NaN, so cdf_ at 108 holds only the tail factor. None of these fits warns.
A check on any NaN ldf_ would be too broad. On clrd, 292 of 779 CumPaidLoss triangles have a NaN ldf_ at some age with no drop at all. A narrower rule would warn only when drop or drop_valuation empties an age and that age still has a NaN ldf_ when a method fits. If you'd rather keep it to the docstring, a note could say that only a tail attached at or before the dropped age replaces its factor. With no tail or a later tail, cdf_ uses 1 for that age.
Which would you prefer?
(This comment was written with Árbol, an AI assistant, under my direction.)
Mirroring them works for me. drop and drop_valuation could each end with "Not protected by preserve." I'd add one sentence after it, because the result surprised me on genins. "If this removes every link ratio at an age, ldf_ is NaN there and cdf_ treats it as 1 unless a tail attaches at or before that age."
None nan 1.0
TailCurve() nan 1.033145
TailCurve(attachment_age=108) 1.0219154962694748 1.055787
Activity
henrydingliu commentedon Nov 18, 2026
drop and drop_valuation intentionally don't warn. we assume that the user has examined the underlying triangle and are consciously making the decision to drop.
drop_hi/lo and drop_above/below are more generic parameters that may be on the default pipeline in a reserving workflow. it used to warn whenever preserve is triggered. we've since tightened it to not warn when preserve is triggered by the natural shape of the triangle, i.e. the tail of the triangle.
so the issue comes down to, are there scenarios where the user is intentionally using drop and drop_valuation but should be warned.
on the whole, i think a warning would be redundant. we can clarify the warning behavior in the docstring.
scks1 commentedon Nov 18, 2026
Thanks, that makes sense for a user who attaches a tail at the dropped age. I checked it on
geninswithdrop=("2001", 108)on main at cc3335c.TailCurve(attachment_age=108)fills the dropped age, as you describe. A tail that attaches after the last age leaves 108-120 as NaN, socdf_at 108 holds only the tail factor. None of these fits warns.A check on any NaN
ldf_would be too broad. Onclrd, 292 of 779 CumPaidLoss triangles have a NaNldf_at some age with no drop at all. A narrower rule would warn only whendropordrop_valuationempties an age and that age still has a NaNldf_when a method fits. If you'd rather keep it to the docstring, a note could say that only a tail attached at or before the dropped age replaces its factor. With no tail or a later tail,cdf_uses 1 for that age.Which would you prefer?
(This comment was written with Árbol, an AI assistant, under my direction.)
henrydingliu commentedon Nov 19, 2026
we could just mirror the drop_hi/lo and say that drop/drop_valuation are not protected by preserve
scks1 commentedon Nov 19, 2026
Mirroring them works for me.
dropanddrop_valuationcould each end with "Not protected bypreserve." I'd add one sentence after it, because the result surprised me ongenins. "If this removes every link ratio at an age,ldf_is NaN there andcdf_treats it as 1 unless a tail attaches at or before that age."Code
The change is two docstring lines, so I'll leave it open for a new contributor.
(This comment was written with Árbol, an AI assistant, under my direction.)