Use of Inverse Gamma for standard deviation and overflow ("ValueError: Mass matrix contains zeros on the diagonal")

I have a hierarchical model where the observations are summary statistics. In particular, we observe the mean and standard deviation of populations (these are cell populations, so they are referred to as “replicates”).

Here’s an individual “plate” from this model for the variance property for a single set of replicates:

So, for example 𝛔(Input11 replicate 0) ~ InverseGamma(𝝻=𝝻(𝞂(Input11)), 𝞂=𝞂(𝞂(Input11))), where 𝞂(𝞂(Input11)) ~ InverseGamma(𝝁=1, 𝝈=1)

What I find is that the variance hyper-parameters, 𝞂(𝞂(Input11)) or hyper_sigma_sigma_Input11 can get extremely large and cause an error in the sampling.

My vague guess is that the data supply hardly any constraint on what those variance parameters could be, and the sampler can explore very large values. Well, that or I made a poor choice in how I structured and parameterized this aspect of the model.

Thanks for any advice.

Try to parameterize the Gamma so that it is more informative (i.e., smaller standard deviation)

Thanks! Actually, I think what I had before that was working was a model with a pymc3.Bound InverseGamma for the hyperparameter, instead of just an InverseGamma. This is a place where there’s a physical constraint on the values such that high variances simply make no sense.