Skip to content

Commit

Permalink
addresses #463
Browse files Browse the repository at this point in the history
  • Loading branch information
John Bogaardt committed Sep 19, 2023
1 parent 0d703c6 commit 857b872
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion chainladder/utils/weighted_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def _fit_OLS_thru_orig(self):
fitted_value = fitted_value * x * (y * 0 + 1)
residual = (y - fitted_value) * xp.sqrt(w)
wss_residual = xp.nansum(residual ** 2, axis)
mse_denom = xp.nansum((y * 0 + 1) * (w != 0), axis) - 1
mse_denom = xp.nansum((y * 0 + 1) * (xp.nan_to_num(w) != 0), axis) - 1
mse_denom = num_to_nan(mse_denom)
mse = wss_residual / mse_denom
std_err = xp.sqrt(mse / d)
Expand Down

0 comments on commit 857b872

Please sign in to comment.