Hello all. I’m hoping someone can help me navigate the web of probabilistic programming packages so that I can begin using the Julia ecosystem for my custom models. I am experienced with Bayesian methods and probabilistic programming, to the point of writing my own samplers 10 years ago, but I’m new to the Julia ecosystem for this.

I am trying to figure out a way to use some combination of Turing, AbstractHMC, AbstractMCMC, etc. to build and sample from custom models. I work with complicated and somewhat expensive models, so I like to be able to build and optimize my own sum-log-likelihood functions.

Attempt 1: I tried to figure out how to do this in Turing to no avail. The best I can find out how to do is construct a custom distribution and attach logpdf methods to them. This is limiting though and in some cases I don’t want to have to work through the Distributions.jl package and so forth.

Attempt 2: I’ve tried to use AdvancedHMC to construct my own LogDensityModel, LogDensityProblems. I have some progress on this, though there are few examples in this space. The problem I run into is that the output of the samplers for this do not produce an appropriate Chain data structure (as far as I can tell) and therefore plotting and analysis that you can perform with the output of the Turing sample are not directly accessible.

While my models are complicated my process is not. I just want to be able to construct my own custom models via a log density function (i.e. both sum-log-likelihood and log-priors) and sample from that using HMC/NUTS. There has to be a way to do this, but I can’t find how Turing, AdvancedHMC, AbstractMCMC, MCMCChains, StatsPlots etc. tie together.

Anyone have suggestions?