Why would scipy/numpy wrapped in @as_op cause much faster sampling than using pytensor operations?

Hi @aseyboldt Thank you so much for the clarifications!

Yeah I’m confident the number of evals is << 2^max_treedepth in my case since the programs are finishing in ~4-10 hours compared to the maximum time of ~40+ hours if all 2^maxtree_depth evals were being taken.

I don’t necessarily want a Uniform prior for the standard deviations but I was curious why I got that error since the docs don’t seem to impose any restrictions for sd_dist. I agree that maybe Gamma is the way to go even moreso than my current Exponential(1) so that I could allow for a small-scale cutoff on the standard deviations (to prevent numerical instabilities in chol/cov) whereas Exponential can in principle go to very small numbers. Ideally I would pick alpha and beta for Gamma such that the standard deviations can’t go below 0.01 and are likely to stay <1.

I assume a TruncatedNormal would work for sd_dist? (Again to prevent very small standard deviations)

I’ve upped my tune to 2000 and draws to 1000 with 2-4 chains and am still getting anywhere from 5-20 divergences, but the posteriors look good (I am doing mock truth tests with known model parameters). I tried increasing tune further without increasing draws and it gives fewer divergences. So I guess I don’t need to worry?