Sample dependent variables in Turing

Ah yes, this was a bug that was recently fixed. In short, the inference was actually performed correctly, but there was a bug in the code transforming the variables to the format we present it to the end-user. If you go to Turing 0.32 everything should work just fine again:)

Can confirm this works on my end with Turing.jl@0.32.3 and 10k samples (reproducible).

Did you see the same problem when sample size is 10^4 (actually I think that’s big enough if I am not mistaken).

Recommend looking at effective sample size (ESS) in the chain when considering “how many samples do I have”. Even if you run 10k iterations, the sampler could get stuck, but that would be indicated in the ESS.

When I run your code (again, on v0.32.3), with 10k iterations I consistently get >5k ESS, which is pleeeeenty for evaluating whether we’re getting the mean correctly:) And in my case, I consistently get 0.5 and 0.25 as expected :+1:

2 Likes