I just noticed something funny while running rstan 2.19.2. I have a model that was getting the max treedepth warning, so I ran
rstan::sampling(..., control = list(max_treedepth=15)). When the model finished sampling I didn’t get any warning, but when I ran
rstan::check_hmc_diagnostics, it once again showed me the treedepth warning. I took a look at the samples csv and it indeed had
# max_treedepth=15 in the header, but when I run:
sampler_params <- get_sampler_params(post, inc_warmup = FALSE) sampler_params_chain1 <- sampler_params[] max_treedepth_by_chain <- sapply(sampler_params, function(x) max(x[, "treedepth__"])) print(max_treedepth_by_chain)
It shows that for each chain 10 was the max treedepth. Is this all expected behaviour?