Hi everyone,
I don’t seem to be able to obtain variance (and consequently SE) for an openCR analysis. I can fit a conditional likelihood model (JASSAlCL) no problem but when I try to obtain N variance estimates using the method=”none”. I get a warning saying:
Warning message:
In openCR.fit(ch_join, start = c(betas, logN), type = "JSSAN", ncores = 10, : variance calculation failed for some beta parameters; confounding likely
And population size estimates shoot from ~70 to ~6000 from one year to another and have nothing to do with the derived estimates I get from the JASSAlCL model.
This is an example of the code I’m using:
JS_CL_p_phi <- openCR.fit(ch_join, type="JSSAlCL", model=list(p ~ t, phi ~ t))
sm <- summary(JS_CL_p_phi, deriv=TRUE)
sm
betas <- JS_CL_p_phi$fit$estimate
names(betas) <- JS_CL_p_phi$betanames
logN <- log(sm$derived$estimates$N)
names(logN) <- c("N", paste0("N.t", 2:length(logN)))
JS_der_p_phi_N <- openCR.fit(ch_join, start=c(betas, logN), type="JSSAN", method="none",
list(p ~ t, phi ~ t, N ~ t))
I tried to also fit simpler model (i.e. fixed p and phi), but I get the same warning).
When I try to fit the full likelihood model with this code:
JS_p_phi_N <- openCR.fit(ch_join, type="JSSAN", list(p ~ t, phi ~ t, N ~ t))
I get the warining:
Warning message:In log(sump) : NaNs produced
Which I’m not sure how to interpret (although parameter estimates seem realistic). The same happens with different methods (I tried “Nelder-Mead” and “SANN”) or any simpler models, e.g.:
JS_N <- openCR.fit(ch_join, type="JSSAN", list(N ~ t))
This is the m.array
> m.array(ch_join)
And this more details on the capture history:
> summary(ch_join)
Any advice on what to look for would be greatly appreciated.
Thanks,
Carlo