# Model specification problem?

**URL:** <https://discourse.pymc.io/t/model-specification-problem/804>\
**Category:** Questions\
**Created:** [January 31, 2018, 3:58pm UTC](https://discourse.pymc.io/t/model-specification-problem/804 "2018-01-31T15:58:06Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [January 31, 2018, 4:46pm UTC](https://discourse.pymc.io/t/model-specification-problem/804/2 "2018-01-31T16:46:52Z")

</div>

Have you check out the diagnostic mentioned here:

> [@Frequently Asked Questions](https://discourse.pymc.io/t/frequently-asked-questions/74/5):
>
> Getting NaN or Inf during NUTS or VI (e.g., 'Bad initial energy: inf. The model might be misspecified., NaN occurred in optimization.)

Most likely I would say is the Deterministic node `P_chooseB` being outside of [0, 1] (the support of `p` in Bernoulli)

---

_[View the full topic](https://discourse.pymc.io/t/model-specification-problem/804)._
