Skip to content

Commit

Permalink
resolves #101
Browse files Browse the repository at this point in the history
  • Loading branch information
jbogaardt committed Nov 6, 2020
1 parent 4454ec6 commit b70790f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions chainladder/core/tests/test_triangle.py
Original file line number Diff line number Diff line change
Expand Up @@ -641,3 +641,9 @@ def test_loc_ellipsis():
assert tri.loc[:, ..., 24:] == tri.loc[..., :, 24:]
assert tri.loc[:, "CumPaidLoss"] == tri.loc[:, "CumPaidLoss", ...]
assert tri.loc[..., "CumPaidLoss", :, :] == tri.loc[:, "CumPaidLoss", :, :]

def missing_first_lag():
x = raa.copy()
x.values[:,:,:, 0] = 0
x=x.sum(0)
x.link_ratio.shape == (1,1,9,9)
3 changes: 2 additions & 1 deletion chainladder/core/triangle.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ def latest_diagonal(self):

@property
def link_ratio(self):
obj = (self.iloc[..., 1:] / self.iloc[..., :-1].values).dropna()
obj = (self.iloc[..., 1:] / self.iloc[..., :-1].values)
obj = obj[obj.valuation<=obj.valuation_date]
if hasattr(obj, "w_"):
w_ = obj.w_[..., 0:1, : len(obj.odims), :]
obj = obj * w_ if obj.shape == w_.shape else obj
Expand Down

0 comments on commit b70790f

Please sign in to comment.