NMix convergence

9 views
Skip to first unread message

Thomas Lee Anderson

unread,
Nov 21, 2025, 5:08:33 PM (8 days ago) Nov 21
to spOccupancy and spAbundance users
Hi all,

I'm am trying to run an NMix model for a data set that has 55 sites that were surveyed over 11 years with 2-8 samples per site and year. I was trying to run the model with the data in stacked format, with year and several habitat variables as covariates in the model to assess temporal patterns in abundance. I am having difficulties getting the model converge, however, and would like advice on what things to tweak to try to get it to work. In particular, some of the traceplots are pretty horrific (see the attached example), with the chains never even mixing at all, even if they were what I thought to be reasonably large number of samples (~100k). Is that an initial values problem? A priors problem? I had been using the values for each of those that were outlined in the NMix vignette (e.g., mean =0, var =100 for beta. normal). I initially thought the stacked format was maybe the problem, but running a single year still wouldn't converge. I also tried simplifying the model to fewer covariates and eventually to intercept-only models, with the latter being the only ones I could get to decently converge. From prior experience using n-mixture models in unmarked and JAGS, I know they can be finicky but this seemed outside of what I've experienced. 

Any thoughts on what to try would be greatly appreciated.

traceplots.jpg

Jeffrey Doser

unread,
Nov 24, 2025, 7:15:27 AM (5 days ago) Nov 24
to Thomas Lee Anderson, spOccupancy and spAbundance users
Hi Thomas,

Thanks for the note. This could be the result of a few different things. First, I would make sure there is substantial enough variation in your covariates in the model such that they aren't confounded with the intercept (e.g., if nearly all sites were completely forested and only a few that were not highly forested, which would result in the forest variable being hard to identify from the intercept). Then, I would of course make sure to check the correlation between covariates as well. What are the characteristics of your data set? Is the species very rare and/or show large amounts of overdispersion or zero inflation in the counts? There could also potentially be confounding between detection and abundance that is making the parameters hard to estimate, as can be the case with N-mixture models. Do the traceplots for the detection variables similarly look bad? If you share your data set/code I can try and take a look to see what's going on.

Kind regards,

Jeff

--
You received this message because you are subscribed to the Google Groups "spOccupancy and spAbundance users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spocc-spabund-u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/spocc-spabund-users/bc3ceb01-cb06-48ac-a4be-589cb553f812n%40googlegroups.com.


--
Jeffrey W. Doser, Ph.D.
Assistant Professor
Department of Forestry and Environmental Resources
North Carolina State University
Pronouns: he/him/his
Reply all
Reply to author
Forward
0 new messages