You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update notebook Dirichlet mixture of multinomials to PyMC 5 (#581)
* Update notebook to pymc v5
Also remove unused import
* Make randomness deterministic
* Update notebook to match new simulated data
Since the simulated data has changed, the numerical issues we faced are slightly different.
The notebook has been modified to reflect this.
- No need to do metropolis sampling for the multinomial model
- Worse numerical issues for the explicit DM model. Addressed by increasing
target_accept and modify the discussion about poor rhat values
- Minor changes to match new data
- Also refer to species by name instead of index.
* Minor changes to notebook text
* Change target_accept from 0.95 to 0.9
This gets rid of most divergences, and gives much better r_hat statistics
* Add myself to author list
* Minor change
* Fix minor text mismatches after updates
* Update unrelated files
The larger $\hat{R}$ value for $\mathrm{frac}_4$ is mildly concerning, and it's surprising
376
-
that our $\mathrm{ESS} \; \mathrm{sec}^{-1}$ is relatively small.
341
+
The slightly too large $\hat{R}$ value for ``frac[mahogany]`` is a bit concerning, and it's surprising
342
+
that our $\mathrm{ESS} \; \mathrm{sec}^{-1}$ is quite small.
377
343
378
344
+++
379
345
@@ -383,7 +349,7 @@ that our $\mathrm{ESS} \; \mathrm{sec}^{-1}$ is relatively small.
383
349
384
350
Happily, the Dirichlet distribution is conjugate to the multinomial
385
351
and therefore there's a convenient, closed-form for the marginalized
386
-
distribution, i.e. the Dirichlet-multinomial distribution, which was added to PyMC3 in [3.11.0](https://github.com/pymc-devs/pymc3/releases/tag/v3.11.0).
352
+
distribution, i.e. the Dirichlet-multinomial distribution, which was added to PyMC in [3.11.0](https://github.com/pymc-devs/pymc3/releases/tag/v3.11.0).
387
353
388
354
Let's take advantage of this, marginalizing out the explicit latent parameter, $p_i$,
389
355
replacing the combination of this node and the multinomial
@@ -405,7 +371,7 @@ nodes together into a single DM node.
Unsurprisingly, the DM outclasses the multinomial by a mile, assigning a weight of nearly
521
-
100% to the over-dispersed model.
522
-
We can conclude that between the two, the DM should be greatly favored for prediction,
523
-
parameter inference, etc.
490
+
Unsurprisingly, the DM outclasses the multinomial by a mile, assigning a weight of 100% to the over-dispersed model.
491
+
While the ``warning=True`` flag for the multinomial distribution indicates that the numerical value cannot be fully trusted, the large difference in ``elpd_loo`` is further confirmation that between the two, the DM should be greatly favored for prediction, parameter inference, etc.
524
492
525
493
+++
526
494
@@ -549,19 +517,16 @@ In that case, swapping the vanilla Dirichlet distribution for something fancier
549
517
## Authors
550
518
* Authored by [Byron J. Smith](https://github.com/bsmith89) on Jan, 2021 ([pymc-examples#18](https://github.com/pymc-devs/pymc-examples/pull/18))
551
519
* Updated by Abhipsha Das and Oriol Abril-Pla on August, 2021 ([pymc-examples#212](https://github.com/pymc-devs/pymc-examples/pull/212))
520
+
* Updated to PyMC v5 by Erik Werner on Oct, 2023 ([pymc-examples#581](https://github.com/pymc-devs/pymc-examples/pull/581))
0 commit comments