# DensityDist error after sampling

**URL:** <https://discourse.pymc.io/t/densitydist-error-after-sampling/6212>\
**Category:** Questions\
**Created:** [November 4, 2020, 5:52pm UTC](https://discourse.pymc.io/t/densitydist-error-after-sampling/6212 "2020-11-04T17:52:17Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![sperezconesa](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/sperezconesa/32/3093_2.png) [@sperezconesa](https://discourse.pymc.io/u/sperezconesa)\
**Post date:** [November 5, 2020, 7:07pm UTC](https://discourse.pymc.io/t/densitydist-error-after-sampling/6212/2 "2020-11-05T19:07:12Z")

</div>

Found the solution here:

> [@Issue with custom likelihood](https://discourse.pymc.io/t/issue-with-custom-likelihood/5885/4):
>
> Hi, Thanks for the suggestion. However, for the scale of the data that prior is reasonably informative (data values range from 1e2 to 1e6). I found that the divergences actually came about because, while trying out different things to get the likelihood working, I’d switched the prior on the amplitude to a Normal (as opposed to the half Normal). So ruling out non-physical values probably stopped the leap-frog steps wandering in to a region the lead to divergences. I am now encountering some o…

---

_[View the full topic](https://discourse.pymc.io/t/densitydist-error-after-sampling/6212)._
