Difficulties in using .dist and pm.Potential for inference

Thank you! Your solution has indeed worked!

The only confusion I have is that the divergences appear when I used “ae.scan” (see 20221018-pymc-question.ipynb · GitHub). I thought that the use of ae.scan is not recommended because it is slower, but not because it is wrong. For example, if simulations use some external code, then the scan could be an option.

You can also dispense with the transformation of μ and σ into μlog and σlog

I am going to implement the mixture model later with the mean and SD would be shared parameters among all three. That is why I am choosing μ and σ as the starting point in my example.