Open
Description
Describe the bug
Doing .ultimate_ on a chainladder model, I'd expect the figures to match the final column of .latest_diagonal_ . However it does not. This seems to occur when there are missing values in some of the triangle.
To Reproduce
import chainladder as cl
tri = cl.load_sample('clrd')
dev = cl.Development().fit(tri)
dev = dev.transform(tri)
model = cl.Chainladder().fit(dev)
ult = model.ultimate_
full_tri = model.full_triangle_
print(ult[(ult.index['GRNAME'] == 'Adriatic Ins Co') & (ult.index['LOB'] == 'othliab') ]['IncurLoss']) # as an example
print(full_tri[(full_tri.index['GRNAME'] == 'Adriatic Ins Co') & (full_tri.index['LOB'] == 'othliab') ]['IncurLoss'])
Expected behavior
Latest diagonals of both full_triangle and ultimate match
assert full_tri.latest_diagonal == ult.latest_diagonal
Desktop (please complete the following information):
- Numpy == 1.26.4
- Pandas == 1.4.2
- Chainladder == 0.8.23