Question about PyMC3 pragmatics

In other probabilistic programming languages, it seems like we often make models that are invertible – we can use them either to generate data, or we can use them to process data (learning, finding MAP assignments, etc.)

But when I have read tutorials about PyMC3, they all seem to build a data generation model using scipy first, and then a PyMC3 model later only for processing data. This seems unnecessarily cumbersome, especially since it’s left to the programmer to figure out how to make the PyMC3 and scipy.stats models line up correctly.

Am I missing something? Any suggestions?

You are absolutely right - we are currently lacking this functionality. There is a WIP pull request to implement this: https://github.com/pymc-devs/pymc3/pull/2983 But we met some complication as there are bugs with the repeated shape/size.

For now, you can use this old (slow) implementation https://github.com/junpenglao/Planet_Sakaar_Data_Science/blob/master/WIP/Test_sample_prior.ipynb

Thank you very much for the pointer! Really appreciate it!