Commit 392b1150 authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

Fix small error in partition_entropy()

parent 886b377c
...@@ -628,7 +628,7 @@ def partition_entropy(B, N, nr=None): ...@@ -628,7 +628,7 @@ def partition_entropy(B, N, nr=None):
if nr is None: if nr is None:
S = N * log(B) + log1p(-(1 - 1./B) ** N) S = N * log(B) + log1p(-(1 - 1./B) ** N)
else: else:
S = lbinom(B + N - 1, N) + scipy.special.gammaln(N) - scipy.special.gammaln(nr + 1).sum() S = lbinom(B + N - 1, N) + scipy.special.gammaln(N + 1) - scipy.special.gammaln(nr + 1).sum()
return S return S
def get_max_B(N, E, directed=False): def get_max_B(N, E, directed=False):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment