# Analysis on result of \`AbstractMCMC.sample\`

**URL:** https://discourse.julialang.org/t/analysis-on-result-of-abstractmcmc-sample/138793
**Category:** Probabilistic Programming
**Created:** [August 13, 2026, 9:43pm UTC](https://discourse.julialang.org/t/analysis-on-result-of-abstractmcmc-sample/138793 "2026-08-13T21:43:16Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![slwu89](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/slwu89/32/217323_2.png) [@slwu89](https://discourse.julialang.org/u/slwu89)
#### Post date: [August 13, 2026, 9:43pm UTC](https://discourse.julialang.org/t/analysis-on-result-of-abstractmcmc-sample/138793/1 "2026-08-13T21:43:17Z")

</div>

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!

```julia-auto
σ² = 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)

```
