Warning problems

Hi, I am trying to launch some analysis using the BAnOCC package, but I am having some problems.

I am working at the ASVs level, with a dataset of 7 samples that after filtering ASVs, and retaining those that have a relative abundance > 10-4 in at least one of the samples, I am left with around 400-500 ASVs.

I have read the article and the tutorial. Arriving at these parameters:
b_fit ← banocc::run_banocc(C = input_reptop_skin_genus, compiled_banocc_model=compiled_banocc_model, chains = 4, cores = 4, iter = 5000, a = 0.5, b=10, verbose = TRUE).

Warning: There were 8 divergent transitions after warmup. See
to find out why this is a problem and how to eliminate them.
Warning: Examine the pairs() plot to diagnose sampling problems

Warning: Bulk Effective Samples Size (ESS) is too low, indicating posterior means and medians may be unreliable.
Running the chains for more iterations may help. See
Begin fitting the model

Please, could you help me to fix those warnings and adjust the parameters properly? Thanks in advance.

You can set the control argument to adjust the Stan parameters to address these issues. control = list(adapt_delta = 0.9) should help address the divergent transitions (IIRC the default is 0.8). Even going up to 0.95 or 0.99 would be okay. Note that this will make the sampling exploration slower, so you may need to set warmup and and iter higher as well. That should help the ESS issues as well I think.

The links in the warning message should help you understand what these messages mean.

Thank you for answering.

But, how much should I increase the warmup and iter values? Thank you.

There’s no hard and fast rule – you can set them to the limit of your patience if need be, or increase them iteratively until the diagnostics are satisfactory. Another thing you could try is to visualize the divergences / other diagnostics in the Fit object returned as part of the results. This link gives some examples on how to do that.