Shinystan trace plot

Hi, I have a question regadring rstan performance.

Recently I am performing model diagnosis with shinystan and I found that the trace plot for one of the parameter looks suspicious to me:

However, all the 4 chains have converged in the aspect of Rhat (around 1) for all the parameters with an effective sample size 4000+. Also the model works well for simulation dataset, but when applied to some real-world dataset it generates such strange traceplot. I have also tried to specify some initial values for that parameter but it did not help.

Could anyone kindly tell me what does this trace plot means? For me it seems that the draws of posterior values of that parameter is stuck at some place, but in this case how could the effective sample size and Rhat still be very good?

Thx!

The error above that says that there were 1264 divergent iterations, which indicates serious issues with the model. The RHat and ESS statistics are not reliable/trustworthy with this many divergences. Try reparameterising your model (more information in this chapter), and/or increasing the adapt_delta target

1 Like

Thanks so much for your kindly reply!

I have tried to include ‘control = list(adapt_delta = 0.99)’ in rstan argument, now there were 501 diverging iterations and the result is still not satisfactory. So does this mean that there might be some geometric difficulties of the posterior distribution and thus I should consider a reparametrization?

Thx!

Yes, reparameterisation looks like the way to go

1 Like