Hello everyone,

This is my first post in a Julia forum! I have really been enjoying studying Turing.jl , Gen, and Julia in general. Thank you to all developers!

I am trying to fit a simple “logit normal” model, that is a typical Binomial model where the probabilities vary between trials. This variation is modeled as a normal distribution on the logit scale. I’m including a reproducible example below. When I run this in Julia 1.2.0 i get a large number of numerical errors, followed by what appears to be a single sample from the posterior (not 2000, as I had hoped). Any help would be appreciated !

```
ns = fill(400, 50)
# Sigmoid function (numerically stable)
sigmoid(x::T) where {T<:Real} = x >= zero(x) ? inv(exp(-x) + one(x)) : exp(x) / (exp(x) + one(x))
# variation in probabilities
ps = sigmoid.(rand(Normal(-1,0.5), 50))
xs = rand.(Binomial.(ns, ps))
@model normal_logit(n, x) = begin
n_obs = length(n)
## hyperparameters for varying effectgs
ā ~ Normal(0, 0.5)
σ_a ~ Truncated(Exponential(3), 0, Inf)
# varying intercepts for each observation
a = Vector{Real}(undef, n_obs)
a ~ [Normal(ā, σ_a)]
p = sigmoid.(a)
for i in eachindex(n)
x[i] ~ Binomial(n[i], p[i])
end
end
normal_logit_samples = sample(normal_logit(xs, ps), NUTS(100, 0.65), 2000)
```