Hierarchical Binomial Model - Not converging

Hi,

I am very new to Bayesian statistics, probabilistic programming and PyMC3, so forgive my simple question.

I am trying to build a very simple model like this:
https://docs.pymc.io/notebooks/GLM-hierarchical-binominal-model.html

The idea would be to estimate the posterior distribution of two groups of individuals tested in two conditions, but the sampler only converges for one of the two data sets. To me the data look fairly similar, so I am not sure what could be causing it.

I’ve seen online that a possible solution would be to implement a non-centred model like this:
https://twiecki.io/blog/2017/02/08/bayesian-hierchical-non-centered/
but I do not know how to implement it here.

You can see a more detailed description of my problem here:

if anyone has any tips on how to reparametrize my model that would be so great :slight_smile:
Thank you,
Federico

Embrace the divergences - it helps you debug your model: https://docs.pymc.io/notebooks/Diagnosing_biased_Inference_with_Divergences.html

In particular, use the diagnostic plot to check where in the parameter space is problematic, and adjust the prior to put more weight to that region.

Thank you, I will try that!