Skip to content

[WIP] Fix to issue #3481. #3484

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

Closed
Closed
Changes from all commits
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
10 changes: 8 additions & 2 deletions pymc3/distributions/continuous.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from pymc3.util import get_variable_name
from .special import log_i0
from ..math import invlogit, logit, logdiffexp
from .shape_utils import broadcast_distribution_samples
from .dist_math import (
alltrue_elemwise, betaln, bound, gammaln, i0e, incomplete_beta, logpow,
normal_lccdf, normal_lcdf, SplineWrapper, std_cdf, zvalue,
Expand Down Expand Up @@ -664,8 +665,13 @@ def random(self, point=None, size=None):
-------
array
"""
mu_v, std_v, a_v, b_v = draw_values(
[self.mu, self.sigma, self.lower, self.upper], point=point, size=size)
mu_v, std_v, a_v, b_v = broadcast_distribution_samples(
draw_values(
[self.mu, self.sigma, self.lower, self.upper],
point=point,
size=size),
size=size,
)
return generate_samples(stats.truncnorm.rvs,
a=(a_v - mu_v)/std_v,
b=(b_v - mu_v) / std_v,
Expand Down