Best way to identify pathologies from divergent transitions (general step by step workflow)

Also I recently worked with Jonah Gabry to improve the vignette on visual diagnostics (of divergences and other issues) in the bayesplot package - it is not yet merged (pull request here: https://github.com/stan-dev/bayesplot/pull/153), but I’ve made the WIP version available in case it is of interest to you: https://popelka.ms.mff.cuni.cz/~cerny/tmp/visual-mcmc-diagnostics-wip.html

This is a good starting point, but often the problem is in a combination of parameters. That’s why the bivariete and trivariate plots in ShyniStan or using pairs and mcmc_parcoord are helpful. In my experience, samples marked as divergent do not necessarily occur at the exact problematic area of parameter space. I would even say, that divergent samples tend to be reported outside of the problematic region, somewhere before the geometry starts to be difficult (note this is my current guess, I am not an expert on the NUTS sampler). We’re having some discussion why this is the case and if/how to improve the diagnostics here: Getting the location + gradients of divergences (not of iteration starting points)

3 Likes