default_moves¶
- ell1fit.mcmc_utils.default_moves()[source]¶
The proposal mix this sampler uses, and why it is not emcee’s default.
Differential evolution proposes along the difference between two other walkers, so its steps line up with whatever direction the ensemble is currently spread over. On a correlated posterior that is the ridge itself, where the stretch move – which only walks toward one other walker – makes far less use of the same information.
Measured on three benchmark posteriors with
tools/sampler_bench.py, three seeds each, effective samples per step against the stretch move: 0.212 to 0.689 at fixture scale, 0.158 to 0.425 at production scale, and 0.075 to 0.307 on a ten-parameter fit with eccentricity free. The cost per step did not move – both moves make exactly one posterior evaluation per walker per step – so the gain is the proposals, not arithmetic. Credible intervals agreed with the stretch move’s within the Monte Carlo error on every parameter.No snooker. emcee’s own recommendation for correlated targets is to mix in
DESnookerMoveat 0.2, and that is what this returned until it was measured rather than assumed. OnP1at 16000 steps over three seeds, all converged, the mix gives 0.717 effective samples per step against 0.919 forDEMovealone – the fifth of proposals spent on the snooker move is worse than not proposing at all, costing 1.28x.Part of that was a scale bug, since fixed:
DESnookerMovebuilds its direction asdelta / sqrt(|delta|), which is not a unit vector, so its step goes as the square of the coordinate scale, and at the oldTARGET_LOCAL_SIGMA = 1e-6it moved walkers two millionths of a posterior width and accepted ~100% because it never went anywhere. One sigma per local unit revives it to 0.861 – real, and still short of dropping it. The recommendation is sound in general; it does not hold on these posteriors.Acceptance runs lower than the stretch move’s, around 0.32 against 0.57. That is what a bolder proposal looks like and not a fault; it stays well clear of the thresholds that report a struggling chain below.