MCMCTempering public consumption? (2024)

What’s the situation with MCMCTempering.jl?

I see 10 months back or so there was some discussion of reviving it, Hamiltonian Monte Carlo gets stuck at tiny local maxima - #14 by torfjelde

I’ve tried the following simple example using MCMCTempering#main


@model function foo2()
    a ~ MixtureModel([Normal(0,1),Normal(4,1)],[0.8,0.2])
end
modval = foo2()

sam = sample(modval,TemperedSampler(MH(0.1^2*I(1)),[1.0,.8,.6]),1000,
    initial_params=[1.0])

But it says something about

ERROR: `make_tempered_model` is not implemented for DynamicPPL.Model{typeof(foo2), (), (), (), Tuple{}, Tuple{}, DynamicPPL.DefaultContext}; either implement explicitly, or implement the LogDensityProblems.jl interface for `model`

It’s just a Turing model so don’t we get LogDensityProblem for free here? Do I need to wrap the model in some other struct?

If I wrap it with Turing.LogDensityFunction(foo2()) it proceeds but borks on trying to index an MH struct with an integer… so anyway. I guess it’s not ready for prime time yet.