From 7fd960ce50395be551f700198e5f0e44f2888ea1 Mon Sep 17 00:00:00 2001 From: Luke LB Date: Thu, 20 Jan 2022 17:49:19 +0000 Subject: [PATCH] Updated release notes with changes in this PR. Added a normalisation to the invalid p parameter in the failing test_multivariate_observations. --- RELEASE-NOTES.md | 1 + pymc/tests/test_idata_conversion.py | 1 + 2 files changed, 2 insertions(+) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 6d8b086002d..19a15a5cdf5 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -132,6 +132,7 @@ This includes API changes we did not warn about since at least `3.11.0` (2021-01 - `math.log1mexp` and `math.log1mexp_numpy` will expect negative inputs in the future. A `FutureWarning` is now raised unless `negative_input=True` is set (see [#4860](https://github.com/pymc-devs/pymc/pull/4860)). - Changed name of `Lognormal` distribution to `LogNormal` to harmonize CamelCase usage for distribution names. - Attempt to iterate over MultiTrace will raise NotImplementedError. +- Removed silent normalisation of p-values passed to Categorical and Multinomial distribution. Instead, a UserWarning is raised when p-values do not sum to 1.0 and then normalisation is done. Normalisation in Categorical now takes place in `dist` rather than `logp`. In addition, negative p-values now raise ValueError. - ... diff --git a/pymc/tests/test_idata_conversion.py b/pymc/tests/test_idata_conversion.py index 240976856d5..317cec450cb 100644 --- a/pymc/tests/test_idata_conversion.py +++ b/pymc/tests/test_idata_conversion.py @@ -588,6 +588,7 @@ def test_multivariate_observations(self): data = np.random.multinomial(20, [0.2, 0.3, 0.5], size=20) with pm.Model(coords=coords): p = pm.Beta("p", 1, 1, size=(3,)) + p = p / p.sum() pm.Multinomial("y", 20, p, dims=("experiment", "direction"), observed=data) idata = pm.sample(draws=50, chains=2, tune=100, return_inferencedata=True) test_dict = {