When can we just hit "the inference button"?

I’ve been reading papers by Emily Fox’s group on multiple time series models with correlations across time and space. Some examples are:
Spatio-Temporal Low Count Processes with Application to Violent Crime Events
Modeling the Complex Dynamics and Changing Correlations of Epileptic Events
In each of these papers - and in almost every paper I’ve read that uses a bayesian approach - the authors define precisely the sampling steps for performing inference. E.g., this is from the 2nd paper linked above:

If I were to implement one of these models in pymc3 and just hit “the inference button,” would that provide an accurate sampling from the posterior?
If not, why not? Is there a way I can perform inference on one of these models in pymc3?
If yes, why do authors always specify the sampling algorithm?
If it depends on the model, are there some rules that determine when we can just hit “the inference button” and when we can’t?

My questions above are just about accuracy - what about speed?

I realize this may be a naive and/or meaty question - thanks in advance for replies.

My understanding of “the inference button” (@twiecki) is that, usually pymc3.sample(...) will just do the right thing. A lot of the development focus is on that: choosing sensible defaults, and setting parameters (near?) optimally. Barring that, @aseyboldt recently added some code that gives you sensible, actionable warnings when pymc3 notices something went wrong.

I haven’t looked at the paper above, though it looks like it is sketching out its own sampler – possibly NUTS doesn’t work in this case?

Speed and accuracy are difficult and meaty questions. PyMC3 has a good progressbar that reports iterations per second (or, sadly, seconds per iteration) which can be misleading, since you really care about effective samples per second. In particular, a Metropolis sampler will appear faster than NUTS, but will have fewer effective samples per second for non-trivial models.

2 Likes