Packages to compute model evidence in the Julia MCMC ecosystem?

Hi,

I’m interested in estimating model evidence (marginal likelihood) for probabilistic models (using the DynamicPPL framework, but let me know if there is something on this matter with Soss.jl). The only available solution I’m aware of is Nested Sampling, but it’s currently not integrated with Turing.
I know they are other solutions out there (e.g. bridge sampling which is maybe more straigthforward when you already have samples drawn from the posterior distribution), but can’t find anything in the Turing ecosystem, and actually in Julia at all.

Is that something people would be interested to have, or is it to specific/model-sensitive to be delivered as a generic package ?

1 Like

There’s definitively an interest in this, as evident by the NestedSamplers.jl package:)

And the reason for not having proper integration with NestedSamplers.jl yet is just because we haven’t gotten around to it yet.

1 Like

Hi !
FWIW I rewrote a bridge sampling package from scratch (mainly from the R source code) : https://github.com/sqwayer/BridgeSampling.jl

I also added a interface with Turing (via DynamicPPL.logjoint and Bijectors). It’s not registered yet since I’m having trouble with automatizing the documentation :sweat_smile:

3 Likes

Nice! And thanks for not making it too Turing-specific, it’s great to be able to connect things like this to Soss.

How heavily did it depend on Distributions? Things work much better for us going through MeasureTheory, so ideally things are ecosystem-agnostic

1 Like

The basic bridgesampling method requires nothing more than an AbstractMatrix of samples, a function that computes the logjoint (completely arbitrary as soon as it takes a sample input and returns a real scalar) and 2 vectors for lower and upper bounds.
So yes pretty agnostic ^^ I’m planning to interface with soss as i did with DynamicPPL, but i’m more familiar with the latter so I started there.

1 Like

Great! Let me know when you get to that, we can talk about a good approach

1 Like