-
Notifications
You must be signed in to change notification settings - Fork 100
'n_periods' does not respect dropped link ratios #604
Copy link
Copy link
Open
Labels
Effort > Brief 🐇Small tasks expected to take a few hours up to a couple of days.Small tasks expected to take a few hours up to a couple of days.Great First Contribution! 🌱Beginner friendly tickets with narrow scope and huge impact. Perfect to join our community!Beginner friendly tickets with narrow scope and huge impact. Perfect to join our community!Impact > Minor 🔷Small, backward compatible change. Treat like a patch release (e.g., 0.5.8 → 0.5.9).Small, backward compatible change. Treat like a patch release (e.g., 0.5.8 → 0.5.9).
Metadata
Metadata
Assignees
Labels
Effort > Brief 🐇Small tasks expected to take a few hours up to a couple of days.Small tasks expected to take a few hours up to a couple of days.Great First Contribution! 🌱Beginner friendly tickets with narrow scope and huge impact. Perfect to join our community!Beginner friendly tickets with narrow scope and huge impact. Perfect to join our community!Impact > Minor 🔷Small, backward compatible change. Treat like a patch release (e.g., 0.5.8 → 0.5.9).Small, backward compatible change. Treat like a patch release (e.g., 0.5.8 → 0.5.9).
Are you on the latest chainladder version?
Describe the bug in words
Description
Currently, when using the
Developmentestimator, then_periodsparameter is applied before any exclusions fromdrop,drop_valuation, etc., are considered. This leads to unexpected results when attempting to exclude specific origin-development combinations from LDF calculations.Current Behavior
In the example below when
n_periods=1is specified along withdrop=[("2009", 12)], the system:Expected Behavior
When
n_periods=1is specified along withdrop=[("2009", 12)], the system should:How can the bug be reproduced?
What is the expected behavior?
The
n_periodsparameter should be applied after all drop logic. It should select thenmost recent link ratios from the set of all valid, non-dropped, non-NaN data points. This ensures that then_periodsargument is always honored when enough valid data is available.