Skip to content

Commit

Permalink
simplify x>0 check in ExponentiatedWeibullDistribution._scipy_cdf
Browse files Browse the repository at this point in the history
the previous check failed with updated dependencies
  • Loading branch information
kawindme committed Aug 21, 2020
1 parent d8de12a commit 248f011
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions viroconcom/distributions.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,8 +462,7 @@ def __init__(self, shape=None, loc=None, scale=None, shape2=None):
def _scipy_cdf(self, x, shape, loc, scale, shape2):
x = np.array(x)
# Ensure x> 0. In Matlab syntax do: x(x < 0) = 0
indices = np.argwhere(x < 0)
np.put(x, indices, np.zeros(indices.size))
x[x < 0] = 0
p = np.power(1 - np.exp(np.multiply(-1, np.power(np.divide(x, scale), shape))), shape2)
return p

Expand Down

0 comments on commit 248f011

Please sign in to comment.