The basic model I'm using is as follows:
- Code: Select all
d.proc <- process.data(GAMO23, # data for mockingbirds
model="Mscjs",
strata.labels = c("A","B"), # infected = A; uninf = B
time.intervals = time_int_2023) # time interval
d.ddl <- make.design.data(d.proc)
# All model params = list(formula=~stratum)
gamomod <- crm(d.proc, d.ddl,
model.parameters = list(S = S.stratum, p = p.stratum, Psi = Psi.stratum),
hessian = TRUE, use.tmb = TRUE, useHess = TRUE, debug = TRUE)
The issue is that the crm model won't complete and when it tries to compute the hessian it returns the error
- Code: Select all
outer mgc: 0.004795544
Computing hessian...
Error in solve.default(f$he(par)) :
system is computationally singular: reciprocal condition number = 4.87297e-27
The model will run if I set hessian = FALSE or if I remove the time intervals. I've also used crm.wrapper to compare all combinations of ~ intercept and ~ stratum models and the crm model returns the same singular error even with the "best" model.
I'm guessing that my issue is that my data are pretty sparse. I have data from 98 individual birds over 100 capture occasions. The intervals between occasions range from 1 to 19 days. Infected individuals were captured on average 1.28 times and uninfected individuals 1.74 times. Transitions between states were relatively rare.
For those who have more experience with capture-recapture data, is this why I'm having trouble getting the model to run? Are there any rules of thumb for how many captures per individual are needed to parameterize the models? Are there any arguments I can modify in crm() to get results?
TIA for any thoughts!