# Multinomial regression on iris dataset convergence issues

**URL:** <https://discourse.pymc.io/t/multinomial-regression-on-iris-dataset-convergence-issues/3764>\
**Category:** Questions\
**Created:** [August 21, 2019, 3:42pm UTC](https://discourse.pymc.io/t/multinomial-regression-on-iris-dataset-convergence-issues/3764 "2019-08-21T15:42:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![eshockley](https://avatars.discourse-cdn.com/v4/letter/e/e495f1/32.png) [@eshockley](https://discourse.pymc.io/u/eshockley)\
**Post date:** [August 21, 2019, 3:42pm UTC](https://discourse.pymc.io/t/multinomial-regression-on-iris-dataset-convergence-issues/3764/1 "2019-08-21T15:42:19Z")

</div>

I’m trying to replicate the multinomial regression on the iris dataset described in this Github issue:  
[https://github.com/pymc-devs/pymc3/issues/1004](https://github.com/pymc-devs/pymc3/issues/1004)  
As far as I can tell, the only thing I’ve changed from the example in the thread is setting the number of cores to 1 to work around the Windows parallel sampling bug, but when I run this the sampling crawls and doesn’t converge:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/pymc3/original/2X/6/6a068617a8cd13cafb080b7e9d8d6742793f778e.png)  
I’ve replicated the same behavior on a Mac with parallel sampling in place. The behavior persists if I fit a subset of the data from only two categories (instead of 3). A binomial regression for a single category (changing the softmax function to sigmoid) runs as expected and converges. Am I missing something or could there be a bug here?

---

<div class="post-metadata">

**Author:** ![junpenglao](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/junpenglao/32/8_2.png) [@junpenglao](https://discourse.pymc.io/u/junpenglao)\
**Post date:** [August 21, 2019, 5:09pm UTC](https://discourse.pymc.io/t/multinomial-regression-on-iris-dataset-convergence-issues/3764/2 "2019-08-21T17:09:02Z")

</div>

Your model is over parameterized - it is thus unidentifiable and doesnt converge. You can for example have a look at [Multinomial hierarchical regression with multiple observations per group ("Bad energy issue")](https://discourse.pymc.io/t/multinomial-hierarchical-regression-with-multiple-observations-per-group-bad-energy-issue/2755/18)

---

<div class="post-metadata">

**Author:** ![eshockley](https://avatars.discourse-cdn.com/v4/letter/e/e495f1/32.png) [@eshockley](https://discourse.pymc.io/u/eshockley)\
**Post date:** [August 21, 2019, 6:20pm UTC](https://discourse.pymc.io/t/multinomial-regression-on-iris-dataset-convergence-issues/3764/3 "2019-08-21T18:20:26Z")

</div>

Thanks for the help! I’ll take a look at that thread.
