Understanding the cause of divergent transitions (no apparent funnel behavior)

This code is discussed also in another thread, and I think it would be better to use splines for non-linearities and use e.g. brms for making the model.