Skip to content

Cap the values that Beta.random can generate. #3924

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
May 15, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
BUG: Make Beta.random to use the clipped random number generator
  • Loading branch information
lucianopaz committed May 15, 2020
commit 4c62f6179fa6a005877682e0516e70bfbe8dd7b8
3 changes: 2 additions & 1 deletion pymc3/distributions/continuous.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
from .dist_math import (
alltrue_elemwise, betaln, bound, gammaln, i0e, incomplete_beta, logpow,
normal_lccdf, normal_lcdf, SplineWrapper, std_cdf, zvalue,
clipped_beta_rvs,
)
from .distribution import (Continuous, draw_values, generate_samples)

Expand Down Expand Up @@ -1290,7 +1291,7 @@ def random(self, point=None, size=None):
"""
alpha, beta = draw_values([self.alpha, self.beta],
point=point, size=size)
return generate_samples(stats.beta.rvs, alpha, beta,
return generate_samples(clipped_beta_rvs, alpha, beta,
dist_shape=self.shape,
size=size)

Expand Down