question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Drop High/Drop Low are not working correctly

See original GitHub issue

I get a different answer depending on whether I fit just the work comp LOB vs all LOBs and then slice work comp. These approaches should yield the same answer, but they don’t:

import chainladder as cl
clrd = cl.load_sample('clrd').groupby('LOB')['CumPaidLoss'].sum()
# Passes
assert cl.Development(n_periods=5).fit(clrd).ldf_.loc['wkcomp'] == cl.Development(n_periods=5).fit(clrd.loc['wkcomp']).ldf_
# Fails
assert cl.Development(drop_low=2).fit(clrd).ldf_.loc['wkcomp'] == cl.Development(drop_low=2).fit(clrd.loc['wkcomp']).ldf_

I don’t think this ever worked. The reason is that we only have one 2D (origin x development) matrix of the entries to be dropped. This matrix is shared across all triangles. When dropping using n_periods, drop_valutation, drop_origin, etc, this is fine. But dropping based on link-ratio values it is not.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:14

github_iconTop GitHub Comments

2reactions
hoveratcommented, Nov 21, 2022

I was with some non-actuaries this weekend, and I expressed some verbal excitement when I saw this issue is being fixed. Even with their desire to join in, the excitement of a working xHiLow average was not easily transferable. Thanks for doing this!

2reactions
henrydingliucommented, Nov 1, 2022

In the code, drop and drop_high/drop_low are applied in parallel. (interestingly enough, drop_above/drop_below are applied after.) Not a difficult thing to put them in any order, but I wonder if the better approach is to allow the practitioner to apply the precise order they want via a pipeline. Unfortunately it looks like Development transformers are memoryless at the moment (see example below).

genins = cl.load_sample("genins")
genins_dev_1 =cl.Development(n_periods = 2).fit_transform(genins)
genins_dev_2 =cl.Development(n_periods = 4).fit_transform(genins_dev_1)
Read more comments on GitHub >

github_iconTop Results From Across the Web

Orthostatic Hypotension - Cleveland Clinic
Orthostatic hypotension causes a sudden drop in blood pressure when you stand up. You may feel dizzy or faint.
Read more >
Excel Drop Down List Not Working (8 Issues and Solutions)
In this article, I'll point out 8 significant issues for why the Drop Down list is not working in Excel and also demonstrate...
Read more >
Low blood pressure (hypotension) - Symptoms and causes
This drop in blood pressure occurs 1 to 2 hours after eating. It's most likely to affect older adults, especially those with high...
Read more >
Video: Drop-down list settings - Microsoft Support
Training: You can use a comma-delimited list, a cell range, or a named range to define the options in a drop -down list....
Read more >
When is Low Blood Pressure An Emergency? - K Health
Even a drop of 20 mm Hg within a few minutes can cause dizziness, lightheadedness, and other uncomfortable symptoms.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found