From 7ab48d58960cfc0cb1fcf72e6295b58e14feaf29 Mon Sep 17 00:00:00 2001 From: Colin Carroll Date: Mon, 18 Nov 2019 22:32:16 -0500 Subject: [PATCH 1/2] Pass size to HalfNormal random method --- pymc3/distributions/continuous.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pymc3/distributions/continuous.py b/pymc3/distributions/continuous.py index 6fcdfdc4f9c..62b77c829c6 100644 --- a/pymc3/distributions/continuous.py +++ b/pymc3/distributions/continuous.py @@ -855,7 +855,7 @@ def random(self, point=None, size=None): ------- array """ - sigma = draw_values([self.sigma], point=point)[0] + sigma = draw_values([self.sigma], point=point, size=size)[0] return generate_samples(stats.halfnorm.rvs, loc=0., scale=sigma, dist_shape=self.shape, size=size) From a968222d226813208894254b0003944cc3fffe18 Mon Sep 17 00:00:00 2001 From: Colin Carroll Date: Tue, 19 Nov 2019 16:42:33 -0500 Subject: [PATCH 2/2] Add note in release notes --- RELEASE-NOTES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 306b1cbfb35..3407e2101e2 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -31,7 +31,7 @@ - Fixed a defect in `OrderedLogistic.__init__` that unnecessarily increased the dimensionality of the underlying `p`. Related to issue issue [#3535](https://github.com/pymc-devs/pymc3/issues/3535) but was not the true cause of it. - Wrapped `DensityDist.rand` with `generate_samples` to make it aware of the distribution's shape. Added control flow attributes to still be able to behave as in earlier versions, and to control how to interpret the `size` parameter in the `random` callable signature. Fixes [3553](https://github.com/pymc-devs/pymc3/issues/3553) - Added `theano.gof.graph.Constant` to type checks done in `_draw_value` (fixes issue [3595](https://github.com/pymc-devs/pymc3/issues/3595)) - +- `HalfNormal` did not used to work properly in `draw_values`, `sample_prior_predictive`, or `sample_posterior_predictive` (fixes issue [3686](https://github.com/pymc-devs/pymc3/pull/3686)) ## PyMC3 3.7 (May 29 2019)