Page 1 of 1

openCR.fit cannot find mask covariate

PostPosted: Wed Aug 25, 2021 8:15 pm
by tmcdonald
I successfully (I think) included a geographic covariate into my mask; but, I cannot get openCR.fit to include that covariate in a model. Here is an example using the oven bird data set:

Code: Select all
testCH <- ovenCH[[1]]
testMask <- ovenmask[[1]]

covariates(testMask) <- data.frame(XX = c(rep(0,1000), rep(1, dim(testMask)[1] - 1000)))

fit <- openCR::openCR.fit(
  capthist = testCH,
  type = "PLBsecrf",
  model = list(lambda0 ~ 1,
               f ~ XX,
               phi ~ 1,
               sigma ~ XX),
  mask = testMask,
  detectfn = "HHN",
  movementmodel = "static",
  trace = TRUE,
  ncores = 1
)


I get
Code: Select all
Preparing design matrices
Error in openCR.design(capthist = capthist, models = model, type = type,  :
  covariate(s) XX not found


I have read nearly all of the secr and openCR vignettes (a lot of material! thank you Murray). They relate how one constructs the mask covariates, but not an example of included them in a model. I hope I did not miss it.

How do we fit a mask covariate in a model?

Re: openCR.fit cannot find mask covariate

PostPosted: Thu Oct 21, 2021 5:51 pm
by murray.efford
Sorry I overlooked this question. Indeed, openCR does not use mask covariates. This is mentioned obscurely as footnote 6 on page 5 of the vignette (!) and also as a difference from 'secr' on page 27:
"These features of secr are not available in openCR
...
5. Density surfaces and other spatial density models
..."

Of course it could be done, but maybe that's just too ambitious with real datasets. In general I think density (uniform or modelled) is better handled in closed population models, with open models kept for when they are really needed (vital rates).

Murray