Brms: fitting negative binomial model with an AR-correlation structure

Hi, sorry for not getting to you earlier.

AR models with non-gaussian families are generally prone to problems as they do not have nice closed forms and if I remember correctly, brms will introduce a ton of nuisance paramters to model the autoregression structure (if you can read Stan code, you’ll see this when inspecting the result of make_stancode). This can make the model badly behaved for all sorts of reasons.

In your case, I would expect that a possible issue is the combination of s(time) and the AR term which both account for some sort of smooth variation over time and so it is likely that their contributions are mostly interchangeable learning both at the same time is not possible (i.e. the model is only weakly identified). So I would try some similar but simpler models such as:

counts ~ s(time) + (1|plot)
counts ~ (1|plot) +  ar(time = time, p = 1, cov = TRUE)
counts ~ (1|plot) +  ar(time = time, gr = plot, p = 1, cov = TRUE)
counts ~ s(time) + (1|plot) +  ar(time = time, p = 1, cov = TRUE)

and see where the problems start to appear.

Best of luck with your model!