Spatially Varying Coefficients among multiple regions

52 views
Skip to first unread message

Miguel Silva

unread,
Sep 18, 2025, 4:59:19 PM9/18/25
to spOccupancy and spAbundance users
Hello all,

I am currently interested in investigating occupancy patterns and relationships with predictors for multiple species that co-occur in multiple regions. Each region is comprised of a grid of camera sites, but although the biomes and several species are similar for all, these regions are fairly distant from each other. I don't want to assume that a species will have the same response among regions, and so was looking into the spatially varying coefficient models that spOccupancy offers. I also have looked into the work from the Bajcz et al. 2024 paper for a multiregion approach with spOccupancy and was interested in knowing if a similar approach would be sensible to use in an SVC model? In essence my research question aims at seeing how responses to the same predictors may vary within each region and among the regions as well. Say the response of a species to "distance to the forest edge" may be different in a highly fragmented region vs a more intact region, even if these distances per se are the same at a given camera. I had initially thought about a similar multi-region approach like the Bajcz paper but my understanding is that although each region is accounted for with a random intercept, it would assume that each species' responses are the same among regions. Is this the case? Is there a way that incorporating SVCs can amend these assumptions? I think I saw a response for a different question that mentioned including dummy variables for region and code those as SVCs. I'm not sure if this would apply for my specific question though. Currently, my occupancy predictors would be something like ~ (site level distance to forest edge) + (regional fragmentation) + (site level distance to nearest human population) + (regional human density) + (1|region). I also considered using interactions between the site and region level predictors but also wasn't sure how adequate it is.

I'm open to all kinds of feedback on all this! Thank you!

Miguel Silva

Jeffrey Doser

unread,
Sep 27, 2025, 8:24:12 PM9/27/25
to Miguel Silva, spOccupancy and spAbundance users
Hi Miguel, 

Apologies for the delay. You could try a model where you include a region-specific effect of your variable of interest (e.g., allow the variable to interact with region), and then also include an SVC. This sort of idea is talked about in our paper on SVCs in GEB here. This would allow you to quantify variation in the effect that occurs as a result of differences across regions, and then the SVC would allow you to account for any other variation in the effect. However, I will mention that an SVC model can be difficult to fit with data that are highly clustered, so you may find it difficult to estimate depending on how far apart your clusters are. If you choose to do such an approach, you may want to consider using an informative prior like the one used in Bajcz et al. 

Hope that helps, 

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/4fad508e-7665-45c5-8256-ef86019dfc39n%40googlegroups.com.


--
Jeffrey W. Doser, Ph.D.
Assistant Professor
Department of Forestry and Environmental Resources
North Carolina State University
Pronouns: he/him/his

Miguel Silva

unread,
Apr 29, 2026, 10:46:56 AM (12 days ago) Apr 29
to spOccupancy and spAbundance users
Hi Jeff,

Thank you for the insight and it's been a while since I've been able to work on this project. Recently, I have been struggling to piece together what a modelling framework for what I need could look like in spOccupancy.  I was initially interested in a model set up similar to the Bajcz et al. (2024) paper, however that is a single species model. Would it be possible to keep this set-up for a multispecies model when the species don't all occur at the same sampling locations?

In my study, I have about 15 camera sampling arrays distributed throughout the world, and was seeking to set up some sort of global model, that would allow for variation in predictor responses among three different continents, several camera arrays (landscapes), and multiple species. I am seeking to model mammal communities at each landscape, and also across all landscapes in our study. My ideal goal is to be able to discern a response at the landscape level as well as a global response. I could of course include random effects or even fixed effects for landscape and continent, but I am unsure about the y array structure, since species are not present at every landscape and no species carry over across continents. The format I understand for the y array for spOcupancy's tMsPGOcc model would require me to include every camera site across the world for each species, and it would mostly be NAs except for the true 1s and 0s where a species occurs. Would this assume though that the species may occur at a site if we would have surveyed since it is included in the array, and thus try to estimate the occupancy of a species at an array far from it's range? Also, I wanted to allow for variation in the species level responses from one landscape to another (for example: I wouldn't want to assume that a puma population in Peru would respond the same way to the same predictor that a population in say Costa Rica). This is why I initially looked towards SVCs but I think with how the sampling data are arranged geographically this may not work out quite well. I have seen this multi-continent/multi-region hierarchical framework set up through NIMBLE but wanted to check if it's possible to set it up in spOccupancy in any way or would the model formatting not quite allow for what I want here?

Thank you for all the help!
Miguel

Jeffrey Doser

unread,
Apr 30, 2026, 5:12:16 AM (11 days ago) Apr 30
to Miguel Silva, spOccupancy and spAbundance users
Hi Miguel, 

There could potentially be a way to fit what you want in spOccupancy, but you may be better off trying to code something up in NIMBLE. Some thoughts below: 
  • You can specify the "range.ind" component of the data list "y" to restrict the set of locations across which a species can occur. This is discussed from a model perspective in our 2025 JABES paper on SVCs. Your "y" array would be a very large object as you mention, but the range.ind component would then restrict what sites in that array each individual species in theory is able to occur at. 
  • Yes, you can apply the approach taken in the Bajcz et al. (2024) paper to a multi-species concept. There is nothing specific about the single-species case that makes it different from the multi-species case. 
  • You are correct that it would be challenging for SVCs alone to work in this situation given the "multi-region" nature of your data set. What you could try would be to simply allow the effect of a given covariate to interact with region, such that there is a different regression coefficient estimated for each region. You could do this as a fixed effect in spOccupancy, but spOccupancy does not allow for random slopes (has long been on my todo list, but I haven't gotten around to it). If you then were concerned about spatial variatiion in the effect within a given region, then this is a situation in which you could also use SVCs, but you would restrict the priors on the SVCs to only explain spatial variation in the effect at smaller scales (e.g., variation within a region). This is analogous to what is done in the Bajcz paper. 
  • I would say it likely makes sense to code something up in NIMBLE unless you are pariticularly concerned with spatial autocorrelation and/or spatial variation in the effect of some covariate within a given region. Otherwise, you could probably accommodate the multi-region structure in a better way (e.g., with random slopes) in NIMBLE. 
Jeff

Miguel Silva

unread,
May 4, 2026, 4:03:27 PM (6 days ago) May 4
to spOccupancy and spAbundance users
Hi Jeff,

Thank you for the response, and it's good to see I may be able to do this within spOccupancy! I would not want to use NIMBLE due to time/processing constraints for a model of this sort. To fit this kind of model in spOccupancy, using the "range.ind" component, would that only be possible with the  "svcTMsPGOcc" function, or can the "tMsPGOcc" function also use "range.ind"? Since I am mainly interested in the variation of responses at the level of each camera array (such as allowing for jaguars at one array to respond to elevation differently than jaguars at a different array) instead of different responses at each camera, I would likely use this interaction then between each covariate and a fixed regional effect. I think this would allow what I want which is to allow for variation in the response of each population, while still also obtaining a global level mean response? However, if this is the case and I wouldn't use SVCs at all, could I do this multiregion model in "tMsPGOcc", or would I need "svcTMsPGOcc" and use it without specifying SVCs? What would the appropriate framework be?

Thank you!
Miguel

Jeffrey Doser

unread,
May 6, 2026, 10:12:04 AM (5 days ago) May 6
to Miguel Silva, spOccupancy and spAbundance users
Hi Miguel, 

Yes, I think in theory using tMsPGOcc in the way you described is what you're looking for. However, the range.ind functionality is not built into that function at the moment. So, your only option would be to use svcTMsPGOcc. However, I do not believe the function will work properly if you set it to not have any SVCs. So, you would have to have at least a spatially varying intercept (i.e., svc.cols = 1) to use the range.ind functionality in svcTMsPGOcc. If you don't want to fit a spatial model, you would have to use NIMBLE or something else. 

Jeff

Reply all
Reply to author
Forward
0 new messages