I am trying to fit a multi-state, multi-stage model for nest survival (sensu Miller et al. 2017) for a species of duck and I can’t figure out what I’m doing wrong when it comes to covariate.predictions().
I have 5 states: 1=alive at laying, 2=alive at incubation, 3=dead during laying, 4=dead during incubation, 5=hatched (and therefore no longer monitored).
I’ve fixed all the biologically infeasible transitions to 0 and fixed S and p to 1. I have also created a time-varying covariate for time-to-hatch for the 2->5 transition since its probability of transitioning should increase the closer the nest gets to estimated hatch date. I also included a quadratic term for this (like they did in the paper) so the probability of hatching can decrease once the estimated hatch date has been surpassed (e.g. for inviable nests).
When I run the following model:
S.stratum <- list(formula =~ 1, link="sin")
p.stratum <- list(formula =~ 1, link="sin")
Psi.test <- list(formula =~ 1 + stratum:tostratum + my25:hatch + my25:hatchsq + to3:robel + to4:robel +to4:water)
test.model <- mark(mstrata.processed, mstrata.ddl,
model.parameters=list(S = S.stratum, p = p.stratum, Psi = Psi.test),
mlogit0=TRUE, hessian=TRUE)
with the vegetation height (robel) and distance to water (water) modeled on the mortality transitions and the two time-to-hatch covariates modeled on the hatching transition, everything seems to work and all of my betas have SE estimates (which was a problem when I tried more complicated models; thus the use of “hessian=TRUE”).
However, when I run
Psi13.robel<-covariate.predictions(test.model,
data=data.frame(robel.values),
indices=c(1:66600),
drop=TRUE)
and include all of the indices for every psi parameter from the all-different PIMS (1:66600), I get an error saying “cannot allocate a vector of size 5387.6 Gb.” Something must be storing improperly or it’s a problem with my data, but I can’t figure out why this would be so large. Any help would be greatly appreciated!