I need some help troubleshooting divergencies (534 out of 30,000 after warmup iterations, 4 chains). It seems that all parametrization guidelines were followed. pairs() plot shows this but I have no clue what to do to remove those divergencies except making adapt_delta 0.9999.

![image|422x421](upload://gf9N5aRQOVjM4OZVsGof8bvhPe2.png class=“attachment” href="//discourse-cloud-file-uploads.s3.dualstack.us-west-2.amazonaws.com/standard14/uploads/mc_stan/original/1X/634b077459f5ca0cfdc13d5e8c0e5edf4e5b0082.stan">doa3.stan (2.7 KB)

I don’t see any immediate problem with the code. Do the divergences go away with adapt_delta = 0.999? If so, that seems like the solution :-)

You might want to reparameterize m0 as normal(0, 1) and define mu[1] = 100 + 5 * m0;.

You can try putting stronger priors on things—looks like the problem you’re having is that you have this exponential weibull function calculating the mean of your normal and vaues of mu[1] around 100. Then you plug that into an exponential. How big are your y values?

Also, the function weibull should be vectorized so that you can vectorize the sampling for y—it’ll be a lot faster.