Apologies for the confusion with the variable names. Below are the first few lines of the traps covariate table again. The only covariate with 'many levels' is region, with 21 levels. The other covariates are (standardized) continuous measures of the amount of some habitat within a buffer around the "trap".
[ins] r$> covariates(trpssub) |> head()
region roadddens nat2000prop humdens forest grassland other seminat built croplnd water sheeppdens nneighbours
A -1.19 -0.46 -0.51 0.78 1.36 -0.28 1.55 -0.71 -1.42 -0.25 0.08 -0.41
A -1.08 -0.55 -0.52 2.09 -0.03 -0.31 0.08 -0.65 -1.42 -0.25 -0.22 -0.41
A -0.94 -0.55 -0.46 0.97 0.01 0.00 2.66 -0.47 -1.22 -0.25 -0.24 -0.41
A -1.13 -0.37 -0.49 2.23 -0.58 -0.31 -0.11 -0.71 -1.42 0.58 -0.21 -0.41
A 0.67 -0.55 -0.41 2.21 -0.30 -0.31 -0.30 -0.66 -1.28 -0.25 -0.30 -0.41
A 0.43 -0.55 -0.37 2.01 -0.77 -0.12 -0.39 -0.15 -1.04 -0.25 -0.36 -0.41
...
Below are a few "test" formula and what they give.
In short, the default detectfn / movement model leads to the likelihood being NA. The HHR detection function works fine with both a static or BVT movement model, if and only if, the included covariate is the same for both sigma and phi (even with a trap covariate on phi, but see my next comment below about this). As soon as two different variables are involved one way or another, I get the Error in markgkParalleldcpp. At least it seems it doesn't segfault anymore.
# default detectfn = "HHN", movement model = "static",
list(lambda0 ~ 1, sigma ~ 1, z ~ 1, phi ~ 1) # --> NA likelihood
list(lambda0 = ~ 1, sigma = ~ forest, z = ~ 1, phi = ~ Session) # --> error in makegkParalleldcpp
list(lambda0 = ~ 1, sigma = ~ forest, z = ~ 1, phi = ~ forest) # --> NA likelihood
list(lambda0 = ~ 1, sigma = ~ Session, z = ~ 1, phi = ~ Session) # --> NA likelihood
list(lambda0 = ~ 1, sigma = ~ forest + Session, z = ~ 1, phi = ~ Session) # --> error in makegkParalleldcpp
list(lambda0 = ~ 1, sigma = ~ forest + Session, z = ~ 1, phi = ~ 1) # --> error in makegkParalleldcpp
# detectfn = "HHR", movement model = "static",
list(lambda0 ~ 1, sigma ~ 1, z ~ 1, phi ~ 1) # --> OK
list(lambda0 = ~ 1, sigma = ~ forest, z = ~ 1, phi = ~ forest) # --> OK
list(lambda0 = ~ 1, sigma = ~ Session, z = ~ 1, phi = ~ Session) # --> OK
list(lambda0 = ~ 1, sigma = ~ forest, z = ~ 1, phi = ~ Session) # --> error in makegkParalleldcpp
list(lambda0 = ~ 1, sigma = ~ forest + Session, z = ~ 1, phi = ~ Session) # --> error in makegkParalleldcpp
list(lambda0 = ~ 1, sigma = ~ forest + Session, z = ~ 1, phi = ~ 1) # --> error in makegkParalleldcpp
# detectfn = "HHR", movement model = "BVT",
list(lambda0 ~ 1, sigma ~ 1, z ~ 1, phi ~ 1) # --> OK
list(lambda0 = ~ 1, sigma = ~ forest, z = ~ 1, phi = ~ forest) # --> OK
list(lambda0 = ~ 1, sigma = ~ Session, z = ~ 1, phi = ~ Session) # --> OK
list(lambda0 = ~ 1, sigma = ~ forest, z = ~ 1, phi = ~ Session) # --> error in makegkParalleldcpp
list(lambda0 = ~ 1, sigma = ~ forest + Session, z = ~ 1, phi = ~ Session) # --> error in makegkParalleldcpp
list(lambda0 = ~ 1, sigma = ~ forest + Session, z = ~ 1, phi = ~ 1) # --> error in makegkParalleldcpp
I initially went for the CJSsecr model rather than one of the JS*secr models, and considered forest and other covariates on phi because we are actually interested in spatial variation in survival ... However, I obviously misunderstood something and did not realise that trap (ie "spatial") covariates could not be used / should not work with the survival parameter phi ... This kind of defeats the purpose of this analysis... Given this, which approach / strategy would you recommend to model spatial variation in survival, then?
Still, I would expect that "more than one covariate" is possible... @murrrray, I send you the dataset and script in a private message.
Olivier