# MCMCTempering public consumption? (2024)

**URL:** https://discourse.julialang.org/t/mcmctempering-public-consumption-2024/122600
**Category:** General Usage
**Tags:** turing, mcmc
**Created:** [November 13, 2024, 6:39pm UTC](https://discourse.julialang.org/t/mcmctempering-public-consumption-2024/122600 "2024-11-13T18:39:33Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![dlakelan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlakelan/32/8491_2.png) [@dlakelan](https://discourse.julialang.org/u/dlakelan)
#### Post date: [November 13, 2024, 6:39pm UTC](https://discourse.julialang.org/t/mcmctempering-public-consumption-2024/122600/1 "2024-11-13T18:39:33Z")

</div>

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](https://discourse.julialang.org/t/hamiltonian-monte-carlo-gets-stuck-at-tiny-local-maxima/108389/14)

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

```julia

@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

```julia
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.

---

<div class="post-metadata">

### Author: ![Red-Portal](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/red-portal/32/9102_2.png) [@Red-Portal](https://discourse.julialang.org/u/Red-Portal)
#### Post date: [February 28, 2025, 1:40am UTC](https://discourse.julialang.org/t/mcmctempering-public-consumption-2024/122600/2 "2025-02-28T01:40:39Z")

</div>

Consider using Pigeons.jl
