Skip to content

Commit 0222c85

Browse files
Volodymyrktwiecki
authored andcommitted
Fixed random() method of NegativeBinomial (#1255)
* Fixed random method of Negative Binomial: scale = 1/beta, where beta=alpha/mu
1 parent 9c30268 commit 0222c85

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pymc3/distributions/discrete.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ def __init__(self, mu, alpha, *args, **kwargs):
240240

241241
def random(self, point=None, size=None, repeat=None):
242242
mu, alpha = draw_values([self.mu, self.alpha], point=point)
243-
g = generate_samples(stats.gamma.rvs, alpha, scale=alpha / mu,
243+
g = generate_samples(stats.gamma.rvs, alpha, scale=mu / alpha,
244244
dist_shape=self.shape,
245245
size=size)
246246
g[g == 0] = np.finfo(float).eps # Just in case

0 commit comments

Comments
 (0)