Hi,

I was previously using pymc3 v3.11.2 and decided to upgrade to v4. After upgrading and making only the necessary changes, the NUTS sampler fails where before it didn’t, with the error message:

ValueError: Mass matrix contains zeros on the diagonal.

The derivative of RV `Uptime_interval__`

.ravel()[[0]] is zero.

The derivative of RV `Downtime_interval__`

.ravel()[[0]] is zero.

The derivative of RV `L`

.ravel()[] is zero.

I know this is notoriously difficult to debug and I’m not really sure what could be causing it, I had encountered it before with pymc3, but the current version of my model runs fine on pymc3.

The only changes I made were renaming theano to aesara and changing how I pass variables to `pm.DensityDist`

.

Does anyone know what change in pymc could cause this?

It would be quite a bit of extra work to post a working version of my model here, so I would prefer not to do that.

Some details that I think may be relevant:

Using the NUTS sampler, both `init="jitter+adapt_diag"`

and `init="adapt_diag"`

run into this problem.

I had seen on other posts that this sometimes solves the issue.

The model is essentially a product of `pm.Normal`

distributions.

I’m thankful for any insights on how to solve this problem.