# Multinomial hierarchical regression with multiple observations per group ("Bad energy issue")

**URL:** <https://discourse.pymc.io/t/multinomial-hierarchical-regression-with-multiple-observations-per-group-bad-energy-issue/2755>\
**Category:** Questions\
**Created:** [February 19, 2019, 2:46pm UTC](https://discourse.pymc.io/t/multinomial-hierarchical-regression-with-multiple-observations-per-group-bad-energy-issue/2755 "2019-02-19T14:46:25Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![AlexAndorra](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/alexandorra/32/9142_2.png) [@AlexAndorra](https://discourse.pymc.io/u/AlexAndorra)\
**Post date:** [February 20, 2019, 2:55pm UTC](https://discourse.pymc.io/t/multinomial-hierarchical-regression-with-multiple-observations-per-group-bad-energy-issue/2755/4 "2019-02-20T14:55:33Z")

</div>

So, after much investigation: turns out my raw data were so corrupt that they contained 7 negative values! So imaginable to me that I didn’t even consider this possibility, but took care of removing `NaNs` and `0s` 😂

Thus, the “Bad energy issue is gone”, but I’m now in quite a pickle, since the trace stops at ~15%, telling me that the “ **mass matrix contains zeros on the diagonal** ”:

 ![mass_matrix_error](https://canada1.discourse-cdn.com/flex036/uploads/pymc3/original/2X/c/cd49e4b8f1b5c91e7ccdc9ff751fcf2dae0626a1.png)  
I tried reparametrizing the model to a non-centered version (as advised [here](https://docs.pymc.io/notebooks/Diagnosing_biased_Inference_with_Divergences.html)) and diminished the hyperpriors (as advised [here](https://discourse.pymc.io/t/model-diagnostics-for-mass-matrix-contains-zeros-on-the-diagonal/957)), but the issue is still there.  
Any ideas on what to do next? I’m quite lost here…

---

_[View the full topic](https://discourse.pymc.io/t/multinomial-hierarchical-regression-with-multiple-observations-per-group-bad-energy-issue/2755)._
