Understanding Spatial Factor and SVC models

18 views
Skip to first unread message

Miguel Silva

unread,
Aug 11, 2025, 12:05:39 PMAug 11
to spOccupancy and spAbundance users
Hi Jeff,

I'm posting this here as a follow-up from our emails to allow for other folks to chime in, knowing you are quite busy. Thank you so so much for all the responses though!!
Essentially, after seeing the resources you shared, this is my understanding from the spatial factor (species correlations) models and the spatially varying coefficients (SVC) models:

  1. The spatial factor models account for species correlations by taking up any residual correlations in the species data that isn't accounted for from the explicitly described covariates right? This won't show me though that species A is highly correlated with species B directly, in the sense of showcasing spatial overlap though right? This would be a post hoc process to determine those spatial relationships?
  2. I know feel like I understand the SVC component of the models a bit better where if I have a large spatial extent and the effects/strengths of covariates might differ between point A and point B for a species, then I would be able to see this. Just like temperature can have two different effects depending on the latitude. This only works on a species level though right? There is no way to see the variation in coefficients at a community level right? So if I have sites with different species makeups in the model, this won't be able to tell me much then compared to if all my species are present at all my sites?
Thank you for all the insight in helping me understand this package and the vast complexity of model types that are offered!

Miguel Silva
he/him/él
PhD Student | Beaudrot Lab
Department of Integrative Biology
Ecology, Evolution, and Behavior Program
Michigan State University
Michigan State University is located on the homelands of the Anishinabek, Mississauga, Peoria, Odawa, Sac, and Fox peoples. https://native-land.ca/

Marc Kéry

unread,
Aug 11, 2025, 1:38:06 PMAug 11
to Miguel Silva, spOccupancy and spAbundance users
Dear Miguel,

about your first question: if you want to compute the actual overlap of distribution between two (or possibly more species), then this is something that can very easily be achieved based on the estimates of presence/absence given in the predictions based on a fitted model object. In an analysis of tiger and leopard with two separate spatial occupancy models (using spPGOcc), my colleague Singye Wangmo and I did this using code like this (for pixel k ---- for a whole map you will have to do a loop):

# Prob. both species are absent
mean(pred.fm3L$z.0.samples[,k] == 0 & pred.fm3T$z.0.samples[,k] == 0)
Prob. only leopard is present
mean(pred.fm3L$z.0.samples[,k] == 1 & pred.fm3T$z.0.samples[,k] == 0)
Prob. only tiger is present
mean(pred.fm3L$z.0.samples[,k] == 0 & pred.fm3T$z.0.samples[,k] == 1)
Prob. both are present
mean(pred.fm3L$z.0.samples[,k] == 1 & pred.fm3T$z.0.samples[,k] == 1)


Then, we can summarize these posterior distributions of realized co-occurrence and make maps of where both species are absent or present or only one of them is, or add up the area of the piece of land where these conditions hold.

I thought that this was pretty cool and that we ought to use the posterior samples of presence/absence much more often in such post-hoc analyses.

Best regards --- Marc






--
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/8ecce740-7c7b-44d3-9f6a-583a3fa95ed5n%40googlegroups.com.


--
______________________________________________________________
 
Marc Kéry
Tel. ++41 41 462 97 93
marc...@vogelwarte.ch
www.vogelwarte.ch
 
Swiss Ornithological Institute | Seerose 1 | CH-6204 Sempach | Switzerland
______________________________________________________________

*** Hierarchical modeling in ecology ***

Message has been deleted

Miguel Silva

unread,
Aug 12, 2025, 7:15:19 AMAug 12
to spOccupancy and spAbundance users
Hi Marc,

Thank you so much for the reply, and this is definitely helpful code to keep in mind! Though, if instead of calculating the overlap between species, I want to see if species are spatially correlated (more likely to co-occur or less likely to co-occur), would I use the residual species correlations from these model outputs, or is there a different better way?

Thank you!
Miguel

Marc Kéry

unread,
Aug 13, 2025, 4:55:12 AMAug 13
to Miguel Silva, spOccupancy and spAbundance users
Dear Miguel,

yes, if you want to test, then it might be best to use a model with a parameter that captures the degree to which species tend to occur together or otherwise. Off the top of my head, I am not sure how to do this with spatial factor models, but probably it can be done. Otherwise, there are the Rota-type of models which can be fit in unmarked (but without spatial autocorrelation). In spite of all of this, you could also make tests for whether two species are more or less likely to co-occur with the posterior draws of site-level presence and absence obtained from fitting a model in spOccupancy and then predicting.

Best regards  --- Marc

Reply all
Reply to author
Forward
0 new messages