Hello,
This may be a bug related to the independent covariate effects, which I haven't tested extensively tbh. To confirm please try with the covariate set to fixed a
or random and see if the plots work then.
Just out of curiosity, is there an important reason to use independent effects instead of random effects?
The general recommendation would be to use random effects unless you have specific reasons not to. Independent effects essentially fit separate models for each species, which can lead to:
1. Less stable parameter estimates
2. Reduced power
3. Potential convergence issues
4. No sharing of information between species
If you're interested in community-level inference or have rare species in your dataset, random effects are likely the better choice, unless you include too few species to use random effects.
I notice you mentioned "no intercepts" but occupancy models require intercepts, and they're being included by default as fixed (same across all species) since you didn't specify them. In community occupancy models, it usually makes more ecological sense to allow species-specific intercepts via random effects, since we expect different species to have different baseline occupancy and detection probabilities.
Here's how I would modify your model:
mod.jags_cov <- communityModel(
model = "RN",
occuCovs = list(independent = c("foret", "vigne")),
detCovs = list(independent = c("mindistancetoriver")),
detCovsObservation = list(fixed = "effort", ranef = "pluie"),
intercepts = list(det = "ranef", occu = "ranef"), # explicitly using random effects for intercepts
data_list = data_listfinale,
modelFile = modelfilem
)
The intercepts = list(det = "ranef", occu = "ranef") argument lets each species have its own intercept drawn from a community distribution, which better reflects ecological reality where species vary in their baseline occupancy and detection probabilities.
Perhaps the communityModel function with benefit from changing the default to using random effects on the intercepts. I'll make a note to address that.
Best,
Jürgen