Thanks for all this. model.debug() is ceertainly helpful.
I’m not sure about the advice regarding building up models slowly. It’s oft repeated and I say it to my students, but in my own coding I find that I really need to write down a fullish model to start thinking clearly about how to simplify it rather than the other way around.
I also think that a lot of model errors come from the sampling somehow entering a regime which is disallowed by the priors, or maybe bad initial conditions. For this, it would be enormously helpful to be able to figure out which node was generating the problem. I understand this is difficult because of PyTensor optimization, but it would be nice if there was an obvious way to produce an un-optimized model where you could get good debugging information.
Finally, about PyTensor: I’m actually just deciding that I need to introduce more material on PyTensor and XArray into the course. PyMC is very hard to use seriously without some comfort with PyTensor and similarly for Arviz and XArray. At least, that’s what I’m finding.
Opher