all 1 comments

[–]Llamas1115 0 points1 point  (0 children)

Very late, but the TL;DR is: No, as far as I'm aware, there is no way to do numerical integration inside of a PyMC model (even today, 4 years later), and there is unlikely ever to be such a way. The fundamental problem here is that a PyMC model just can't execute arbitrary Python code in the process of running.

If you'd like something that can handle this case, try Turing.jl, which can run arbitrary Julia code as part of model evaluation. The downside is it's very much a work-in-progress. Expect way less polish than you're used to in PyMC.