Skip to content

Implement TrendConstant() #582

@kennethshsu

Description

@kennethshsu

Discussed in #506

Originally posted by vdunaway April 4, 2024
Could someone please provide more details on how the multipart trending works, specifically the math behind what chainladder is doing and how to properly enter the dates for what you intend? I've been toggling the start/end dates and it's not working as intended, thus, potentially the documentation/user-guide could be enhanced regarding this.

For example, say I want to apply a multi-step trending that incorporates the following:

Trends for Year X-1 to X*  
  Annual
Year Trend Rate
Prior to 2021 3.5%
2021 10.0%
2023 5.0%
   
Trend To Date = 12/31/2024
   
*trend rate remains the same until
new trend in list  

When I run through chainladder, I don't get what I was expecting. Am I inputting the dates incorrectly?

p = pd.DataFrame({'Year': list(range(2014,2024)), 'Premium': [10000]*10})
p_tri = cl.Triangle(p, origin='Year', columns='Premium', cumulative = True)

test = cl.Trend(
    trends=[.05, .1, .035],
    dates=[('2024-12-31', '2022'),('2022', '2020'),('2020','1990')]
).fit(p_tri).trend_

test
Out[71]: 
          2023
2014  1.661630
2015  1.605439
2016  1.551149
2017  1.498695
2018  1.448014
2019  1.399048
2020  1.278334
2021  1.162121
2022  1.102500
2023  1.050000

Dissecting the chainladder output and comparing to expectation, how would one enter the dates into cl.Trend() to obtain the expected result?

  Chainladder Output Chainladder Resulting YoY Trend Factor Expected YoY Trend Factor Expected Result
2014 1.6616298 1.0350000 1.0350000 1.6398573
2015 1.6054394 1.0350000 1.0350000 1.5844032
2016 1.5511492 1.0350000 1.0350000 1.5308244
2017 1.4986949 1.0350000 1.0350000 1.4790574
2018 1.4480144 1.0350000 1.0350000 1.4290409
2019 1.3990477 1.0944308 1.0350000 1.3807159
2020 1.2783336 1.1000000 1.1000000 1.3340250
2021 1.1621214 1.0540784 1.1000000 1.2127500
2022 1.1025000 1.0500000 1.0500000 1.1025000
2023 1.0500000 1.0500000 1.0500000 1.0500000

Metadata

Metadata

Assignees

No one assigned

    Labels

    Effort > Serious 🐘Large, complex tasks requiring a few weeks to months of work.Impact > Significant 💠High impact changes. Should only be done in response with community inputs.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions