Chainladder: does it work with multi-triangles with non-aligned valuation periods?

  python, triangle

Trying to extract properties from the triangle / development class(e.g..age_to_age) give it was parameterized with multiple triangles each with different valuation dates.

This example illustrates the issue:

import chainladder as cl
import pandas as pd

data = [['2010-01-01', '2011-06-30', 'premium', 100.0], ['2010-01-01', '2011-12-31', 'incurred', 100.0],
        ['2010-01-01', '2012-06-30', 'premium', 200.0], ['2010-01-01', '2012-12-31', 'incurred', 100.0],
        ['2010-01-01', '2013-12-31', 'incurred', 200.0], ['2011-01-01', '2011-06-30', 'premium', 100.0],
        ['2011-01-01', '2012-06-30', 'premium', 200.0], ['2011-01-01', '2012-12-31', 'incurred', 100.0],
        ['2011-01-01', '2013-12-31', 'incurred', 200.0], ['2012-01-01', '2012-06-30', 'premium', 200.0],
        ['2012-01-01', '2013-12-31', 'incurred', 200.0]]

df = pd.DataFrame(data, columns=['origin', 'val_date', 'idx', 'value'])

cl_tri = cl.Triangle(data=df, index='idx', columns='value', origin='origin', development='val_date', origin_grain='%Y',
                     origin_format='%Y-%m-%d', development_format='%Y-%m-%d', cumulative=True)

Then filter the Triangle to extract features but it has ‘exploded’ the valuation dates, and results are non-sensical:

cl_tri.iloc[0].age_to_age

cl.Development().fit_transform(cl_tri.iloc[1]).ldf_

What is the best way of dealing with this situation? Separate class objects?

Source: Python Questions

One Reply to “Chainladder: does it work with multi-triangles with non-aligned valuation periods?”

  • Probably. A “multi-triangle” shares its `origin` and `valuation` dates across all individual triangles contained within it. If your data has distinctly different valuations for different measures (columns), it won’t be beneficial to group them together.

LEAVE A COMMENT