'Stacked' spatial model in spAbundance

23 views
Skip to first unread message

Sean Sultaire

unread,
Oct 22, 2024, 10:17:52 AMOct 22
to spOccupancy and spAbundance users
Dear Group,

I have been using spOccupancy for some time now to and find it to be an excellent package, thank you developing this resource. Specifically I have used the function stPGOcc to fit spatiotemporal occupancy models with good success. However, a couple of my focal species are quite common and I am interested in fitting models in spAbundance for those species. I have gotten the NMix function to work with a site-level random intercept to three years of data but ideally the model would also to include a spatial component.

Is it possible to fit a model using spNMix when you have multiple observations from the same site (i.e., a stacked model)?

Any information on this topic would be greatly appreciated

Sean

Jeffrey Doser

unread,
Oct 22, 2024, 12:09:02 PMOct 22
to spOccupancy and spAbundance users
Hi Sean,

Thanks for the great question and kind words about the package. Unfortunately, the spNMix() function isn't able to fit a stacked spatial model. At the moment, it will only work when the rows in the "y" matrix correspond to sites (i.e., each row in y is required to have a unique pair of coordinates), and it won't allow for multiple surveys over time for the same site (since the site has the same coordinates over time). As you point out, your data set up is possible for working with the non-spatial function NMix(). The same is true for the distance sampling functions in the package (can fit a stacked model with DS() but not spDS()). You can fit a "stacked" GLMM using any of the abund() type functions, but that likely won't be of any use since you want to fit an n-mixture model. I'm hoping at some point down the road to add in the functionality for stacked (multi-season) models for the N-mixture and distance sampling functions. 

There is one workaround that you could try, which is to add a very small amount of noise to the coordinates in the "coords" matrix for the repeated observations for the same site, which will allow the model to fit. It is certainly not ideal and could lead to difficulties in getting the model to converge, but it could at least allow you to explore how much spatial autocorrelation there is to see if you need to move beyond your approach with NMix() or if the non-spatial model is adequate enough.

Hope that helps, and let me know if I can clarify anything.

Jeff 

Sean

unread,
Oct 24, 2024, 4:51:36 PMOct 24
to spOccupancy and spAbundance users
Thanks for the quick response and for confirming my suspicions that these models are challenging to fit. I will consider jittering the coordinates and see if the models converge. I imagine I would need to increase the n.neighbors argument to account for the temporal replicates being treated as 'neighbors' with this approach.

Sean

Jeffrey Doser

unread,
Oct 25, 2024, 8:10:32 AMOct 25
to spOccupancy and spAbundance users
Yes good point, for using such an approach it would be ideal to increase n.neighbors by the maximum number of years/seasons you have at a given site. 

Jeff

Reply all
Reply to author
Forward
0 new messages