Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENH] How can I vary loss development factors by year? #499

Open
BenL-github opened this issue Mar 21, 2024 · 3 comments
Open

[ENH] How can I vary loss development factors by year? #499

BenL-github opened this issue Mar 21, 2024 · 3 comments
Assignees

Comments

@BenL-github
Copy link

Is your feature request related to a problem? Please describe.
For development constant, how can I vary the loss development factors by year? I would like to know how to do this so the ultimate values vary based on a different loss development pattern by year.

The current docs has this snippet of code

patterns={12: 2, 24: 1.25, 36: 1.1, 48: 1.08, 60: 1.05, 72: 1.02, 84: 1.0, 96: 1.0, 108: 1.0}
cl.DevelopmentConstant(patterns=patterns, style='ldf').fit(triangle).ldf_
12-Ult 24-Ult 36-Ult 48-Ult 60-Ult 72-Ult 84-Ult 96-Ult 108-Ult
(ALL) 2.0000 1.2500 1.1000 1.0800 1.0500 1.0200 1.0000 1.0000 1.0000

This is the pattern I would like to create:

12-Ult 24-Ult 36-Ult 48-Ult 60-Ult 72-Ult 84-Ult 96-Ult 108-Ult
2010 1.0000
2011 1.0070 1.0000
2012 1.4000 1.0000 1.0400
2013 1.0200 1.5000 1.0600 1.0000
... ... ... ... ... ... ... ... ... ...
2019 1.0000 1.0700 1.1000 1.0800 1.0500 1.0200 1.5000 1.0600 1.0000

Is your feature request at odds with the scope of the package?
No

Describe the solution you'd like
Written code example of how I can resolve my issue, or a link to documentation that has an example of how I can do it.

Describe alternatives you've considered
Reading documentation

@kennethshsu
Copy link
Collaborator

Hi @BenL-github, such functionality doesn't exist yet. A triangle is supposed to get a single set of patterns.

Can you explain a bit more on why you need multiple sets of pattern within a single triangle? Can't you artificially "vary" the patterns by backing it into the most recent age-to-age factor?

@BenL-github
Copy link
Author

Can't you artificially "vary" the patterns by backing it into the most recent age-to-age factor?

Could you elaborate more on what you mean by this, or provide an example?

@kennethshsu
Copy link
Collaborator

Hi @BenL-github, let me make sure I understand what you are trying to do first.

I think you want each origin year to have a unique LDF patters associated with them, so basically if you have n-origin years, you wanted to use n-sets of LDF patterns. Is that right?

The way I think about this is that each origin year can have these unique patterns by backing the desired CDF into their LDFs, because at the end of the day, what you need is the CDFs for the various actuarial models, not so much the LDFs.

For example, here we have 3 origin years, each with a unique LDF development pattern.

Origin Year 12-24 24-36 36-ult age-to-ult (CDF)
1 1.0500 1.0500
2 1.1000 1.0300 1.1330
3 1.3000 1.0500 1.0200 1.3923

Here, since chainladder only takes in one pattern per triangle, what we can do is that we can modify the appropriate age-to-age factor by backing into them.

Origin Year 12-24 24-36 36-ult age-to-ult (CDF)
1                              1.0500                        1.0500
2 1.0790
= 1.133 / 1.0500 (backed in)
1.0500
(set as above)
1.1330
(set as prior scenario)
3 1.2289
= 1.3923 / 1.0500 / 1.0790 (backed in)
1.0790
(set as above)
1.0500
(set as above)
1.3923
(set as prior scenario)

This way, our LDF patterns are, 1.2289, 1.0790, and 1.0500, which is only 1 set of pattern, while reflecting the uniqueness of each origin year's pattern that we wanted.

Is this what you are asking for and does this help?

If you really want to vary the patterns, such as if you need to calculate actual vs expected at the incremental level, I think our only solution is to divide up the origin years into different segments using the index feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants