How to (if possible) re-write this simple censored Poisson model without Turing.@addlogprob!

Here’s the refined model written in the more user-friendly way. What is great, is that the sampling errors when I use the NUTS sampler are gone!!

@model function binomial_model_fast(nzero::Int, N::Int)
    λ ~ Uniform(0, 100)
    nzero ~ Binomial(N, pdf(Poisson(λ), 0)) # pdf(Poisson(λ), 0) is proportional to exp(-λ), so we can just write `nzero ~ Binomial(N, exp(-λ))`
end
model = binomial_model_fast(nzero, N);

Thank you @Dan for the recommendation that it is actually a Binomial model. I am very grateful for this insight!

1 Like