openCR: variance calculation failed for some beta parameters; confounding likely

23 views
Skip to first unread message

carlo....@gmail.com

unread,
Jan 29, 2025, 10:22:36 PMJan 29
to secr

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)
Object class       capthist Detector type      count (28) Detector number    180 Average spacing    51.50029 m x-range            467374.7 470340.4 m y-range            7524299 7529426 m  Counts by occasion                     1   2   3   4   5   6   7   8   9  10  11  12  13  14  15  16  17  18n                  30  36  36  34  31  35  34  35  38  32  29  34  37  32  38  38  40  30u                  30  16  13   7   4   1   2   6   2   2   0   1   4   1   9   7   6   3f                  52  17   6   9   9  10   5   5   4   8   5   5   8   5   3   3   3   4M(t+1)             30  46  59  66  70  71  73  79  81  83  83  84  88  89  98 105 111 114losses              0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0detections         44  57  56  48  48  53  56  50  61  55  48  52  59  51  53  51  56  43detectors visited  33  38  43  32  34  38  35  35  40  39  29  33  36  34  41  37  41  32detectors used    180 180 180 180 180 180 180 180 180 180 180 180 180 180 180 180 180 180                   19  20  21  22  23  24  25  26  27  28 Totaln                  38  38  46  37  48  47  39  41  46  46  1045u                   3   4   5   7   8   8   4   5   5   3   166f                   1   2   1   0   0   1   0   0   0   0   166M(t+1)            117 121 126 133 141 149 153 158 163 166   166losses              0   0   0   0   0   0   0   0   0   0     0detections         50  56  64  48  61  62  53  63  65  64  1527detectors visited  37  39  41  38  51  48  41  47  45  48  1085detectors used    180 180 180 180 180 180 180 180 180 180  5040 Individual covariates Sex    F:87   M:77   -: 2

 

Any advice on what to look for would be greatly appreciated.

 

Thanks,

Carlo

 

Murray Efford

unread,
Jan 30, 2025, 2:29:39 PMJan 30
to secr
Hello Carlo
I can't help with the specifics, but note that the warning you got for type JSSAN is ignorable if it affects a single likelihood evaluation (you can see the algorithm recover and proceed to maximisation by setting trace = TRUE).
Murray
Reply all
Reply to author
Forward
0 new messages