VI fitting of custom pdf sporadically producing 'nan' parameter values which terminate fit

I was going to suggest you use the exgaussian cdf, but I see you already encountered it (I recently did some improvements in the stability of the logcdf method, in a more recent version of pymc: Improve ExGaussian logcdf and refactor logp by ricardoV94 · Pull Request #4407 · pymc-devs/pymc3 · GitHub). We are aware of the lack of C support for the erfcx method in theano, and we hope to have it fixed soon. Do you notice a sizeable slowdown besides the warning?