Skip to content

Commit 3beb62c

Browse files
committed
Added an undeflow protection.
1 parent cada182 commit 3beb62c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

structure_threader/wrappers/maverick_wrapper.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,9 @@ def maverick_normalization(x_mean, x_sd, klist, draws=int(1e6), limit=95):
312312
"""
313313
# subtract maximum value from x_mean (this has no effect on final outcome
314314
# but prevents under/overflow)
315-
# Just like in the original implementation (even though it should not be
316-
# required in the python version)
315+
# Just like in the original implementation
316+
x_mean = [x - max(x_mean) for x in x_mean]
317+
317318
z_array = np.zeros([len(x_mean), draws])
318319

319320
# draw random values of Z, exponentiate, and sort them in a bidimensional

0 commit comments

Comments
 (0)