Hi all,
I'm working on fitting a single-species, multi-season occupancy model. As occupancy covariates I have 6 different variables, five of which are static and one is dynamic, having different values for each year. To incorporate it in the model I have created a matrix with rows corresponding to sites (cameras) and columns corresponding to years.
When I try running the model I encounter the following error message:
Error in stPGOcc(occ.formula = ~ruggedness + forest + specific_vegetation + : c++ error: which failed.
I have tried running the model without the dynamic covariate and it works just fine, so I assume it's something related with the data structure of that covariate.
The model I'm trying to run is the following:
model_HZop1 <- stPGOcc(
occ.formula = ~ ruggedness + forest + specific_vegetation + hunting_zone_op1 + (1|IDcam),
det.formula = ~ effort + forest + specific_vegetation + ruggedness + year,
data = data_list,
n.batch = 1500,
batch.length = 50,
n.burn = 20000,
n.thin = 2,
n.chains = 3,
verbose = TRUE,
)
I've aslo attached a picture below where you can visualize the data structure. Do you have any idea of what is causing this error and how I could fix it? There are no missing values in the dynamic covariate and I also don't have any duplicated coordinates.
Thank you in advance!
Kind regards,
Gemma