Problems with Divergent Transitions, adapt_delta > 0.99999


Hello and happy new year.
I am working on an hierarchical, Bayesian model for water quality around the Chesapeake Bay and can’t seem to avoid getting divergent transitions despite setting adapt_delta really high. Any suggestions on improving my code (below) would be greatly appreciated. Thanks so much.


foo is data on water quality parameters around chesapeake bay
e.g. lPC = log(particulate carbon), lTP = log(total phosphorous)
lCHLA = log(chlrophyll-a, an indicator of algae biomass)
season = spring, summer, fall
Sbin = 7 spatial clusters, based on attributes of land around water monitor
poly(NR,3) = 3-order polynomial for nitrogen ratio (nitrate/ammonium ratio)



foo <- readRDS(gzcon(url(‘’))) %>%
filter(season != ‘winter’)

HB <- stan_glmer(lCHLA ~ PH+lPC+lTP+lDO+poly(NR,3)+
,prior_intercept = normal(0,10)
,prior = normal(0, 1),
, data = foo
, family = gaussian(link = “identity”)
,chains=3, iter=1000, warmup=500, cores = 4
,control = list(
adapt_delta = 0.99999


My guess is ICHLA has weird units, so either rescale that or change the prior on sigma.