I have been enjoying fitting RL model using pymc4 so far! However I just now encountered an issue that I have no idea how to fix. In my study, I aim to compare two RL models. RL1 is just the classic Q learning model. RL2 is pretty much the same except I added another parameter that dictates how my task condition may change reward representation. I first simulated data from the priors of RL1 and RL2, and then fit using pymc. Both did not give any error. However, when I fit them onto my real data, RL1 fit just fine, RL2 gives me the following error:

RuntimeWarning: divide by zero encountered in true_divide

RuntimeWarning: invalid value encountered in multiply

ValueError: Mass matrix contains zeros on the diagonal.

The derivative of RV`alpha_logodds__`

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

The derivative of RV`beta_log__`

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

The derivative of RV`decay_logodds__`

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

The derivative of RV`gamma`

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

My first thought is that maybe the likelihood function of my RL2 did not succeed in dealing with missing data NaN. The real data has NaN but the simulated data obviously does not. Then I separately tried to run the likelihood function of RL2 on the real data with some hand-typed parameter values. Surprisingly the function ran just fine. Which means my likelihood function deals with NaN just fine. But since RL2 did not give any error on the simulation data, then the model specification should also be fine. Could anyone please tell me what I should do in this case? Is there a way for me to print aesara objects in real-time so I can trouble shoot exactly which stage went wrong?