Hello All:
I am currently engaged in the development of a hierarchical Bayesian mixture model. During this process, I have encountered warning messages related to max_treedepth and target_accept. To address these issues, I’ve introduced specific arguments into my code. Despite adjusting the max_treedepth to 30, my chains continue to encounter the max_treedepth issue, which is perplexing as it occurs even when the depth is below the value I set (as illustrated in the figure below). Moreover, I have increased the target_accept parameter from 0.99 to 0.9999. However, this adjustment does not seem to impact the sampling speed, leading me to suspect that the target_accept parameter might not be updating correctly. I have attempted to implement these arguments in two different ways, but unfortunately, neither approach has been successful.
Would you please see if my code/approach has some problems?
Thanks for your advice from this community,
Jay
trace = pm.sampling.mcmc.sample(draws = n_draws, tune = n_tune,
chains = n_chains, cores = n_cores, init = "advi+adapt_diag",
step = [pm.NUTS()], nuts_sampler_kwargs = {"max_treedepth": n_treedepth,
"step_scale": step, "target_accept": score_mcmc}, random_seed = seed, progressbar= bar_status);
trace = pm.sampling.mcmc.sample(draws = n_draws, tune = n_tune,
chains = n_chains, cores = n_cores, init = "advi+adapt_diag",
step = [pm.NUTS(max_treedepth = n_treedepth, step_scale = step,
target_accept = score_mcmc)], random_seed = seed, progressbar= bar_status);