External C++ functionality of PyMC3

Hello everyone,

My partner and I had a couple of questions regarding the external C++ functionality of PyMC3. Specifically, we wanted to determine whether it’s possible to call and use external C++ code in conjunction with PyMC3? Additionally, would it be possible to call and use an external C++ static library when using the external C++ functionality of PyMC3 (assuming this functionality exists)?

We were hoping to find this functionality within Stan; however, the fashion in which this functionality would need to be incorporated in order to work with Stan would not be plausible for the solution we are attempting to incorporate.


Hi Matt,
Yes this is possible, in general the approach is to expose a python API to your C++ library, and wrap it with theano so that PyMC3 model can understand it. The best place to start is: https://docs.pymc.io/notebooks/blackbox_external_likelihood.html