Hi, I have 2 questions. Say I’m using the MALA sampler from AdvancedMH.jl, I think the following is the easiest way to compute the acceptance %, is that correct or is there some other method? Second question is regarding the return value, I get a vector of AdvancedMH.GradientTransition back from sample; is there a better way to convert to MCMCChains.Chain? (I can’t just use chain_type=Chains in sample because it seems then it’s not possible to use AbstractMCMC.getstats(t).accepted to calculate acceptance %).
Thanks!
σ² = 0.05
spl = MALA(x -> MvNormal((σ² / 2) .* x, σ² * I))
chain = sample(ℓ_ez, spl, 10_000; initial_params = ones(2), param_names=["μ", "σ"])
acceptance = count(t -> AbstractMCMC.getstats(t).accepted, chain) / length(chain)
mcmc_chain = Chains(reshape(permutedims(reduce(hcat, t.params for t in chain)), :, 2, 1), ["μ", "σ"])
plot(mcmc_chain)