Skip to content

Commit

Permalink
correct planck distribution
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisb83 committed Oct 4, 2018
1 parent 78831ed commit 14596f0
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions scipy/stats/_discrete_distns.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,14 +554,10 @@ class planck_gen(rv_discrete):
"""
def _argcheck(self, lambda_):
self.a = np.where(lambda_ > 0, 0, -np.inf)
self.b = np.where(lambda_ > 0, np.inf, 0)
return lambda_ != 0
return lambda_ > 0

def _pmf(self, k, lambda_):
# planck.pmf(k) = (1-exp(-lambda_))*exp(-lambda_*k)
fact = (1-exp(-lambda_))
return fact*exp(-lambda_*k)
return (1-exp(-lambda_))*exp(-lambda_*k)

def _cdf(self, x, lambda_):
k = floor(x)
Expand Down Expand Up @@ -593,7 +589,7 @@ def _entropy(self, lambda_):
return l*exp(-l)/C - log(C)


planck = planck_gen(name='planck', longname='A discrete exponential ')
planck = planck_gen(a=0, name='planck', longname='A discrete exponential ')


class boltzmann_gen(rv_discrete):
Expand Down

0 comments on commit 14596f0

Please sign in to comment.