Skip to content

Commit f2a651c

Browse files
committed
Adding check for expsum.
1 parent dc6c701 commit f2a651c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Scripts/models/logit.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ def _calc_mode_util(self, impedance):
5959
exps = numpy.exp(utility)
6060
self.mode_exps[mode] = exps
6161
expsum += exps
62+
if expsum.min() == 0:
63+
raise ValueError("Exponentiated utility sum must be greater than zero. The impedance might be too high.")
6264
return expsum
6365

6466
def _calc_dest_util(self, mode, impedance):

0 commit comments

Comments
 (0)