NA in density estimates if varying effort is added

30 views
Skip to first unread message

Ide Uitentuis

unread,
Apr 14, 2024, 6:38:36 AMApr 14
to secr
Hi everyone,

I'm new to 'secr' but I'm trying to calculate the Population density of cats after I identified the Individuals captures by 86 camera traps. The pictures were analysed in Agouti and from the export data package I created new data frames 'captures' and 'traps'. I created a capthist-object with make.capthist() and calculated the population density using secr.fit(). 
After creating the capthist-object I receive the following warning message:
In subset.capthist(x, OK, ...) : no detections on occasion(s) 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 26, 28, 36, 37, 38, 39, 41, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 82, 83, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134
I suppose that I don't have to worry about this warning message, since the camera trap number 1 only operated from occasion 22 until occasion 35. Nevertheless I calculated the population density with secr.fit() and get the following results:
> fit secr.fit(capthist = capthist_cat_o, verify = TRUE, trace = FALSE) secr 4.6.6, 12:12:50 14 Apr 2024 Detector type count Detector number 79 Average spacing 673.2793 m x-range 2677614 2688170 m y-range 1242697 1253756 m Usage range by occasion 1 min 134 max 134 N animals : 173 N detections : 722 N occasions : 1 Count model : Binomial, size from usage Mask area : 259.854 ha Model : D~1 g0~1 sigma~1 Fixed (real) : none Detection fn : halfnormal Distribution : poisson N parameters : 3 Log likelihood : -701.0359 AIC : 1408.072 AICc : 1408.214 Beta parameters (coefficients) beta SE.beta lcl ucl D -0.3890779 0.07607481 -0.5381818 -0.239974 g0 -3.4522042 0.04144097 -3.5334270 -3.370981 sigma 5.2580021 0.04180303 5.1760696 5.339934 Variance-covariance matrix of beta parameters D g0 sigma D 5.787376e-03 -0.0001104437 7.149273e-06 g0 -1.104437e-04 0.0017173536 -5.493873e-04 sigma 7.149273e-06 -0.0005493873 1.747493e-03 Fitted (real) parameters evaluated at base levels of covariates link estimate SE.estimate lcl ucl D log 0.67768147 0.051629169 0.58380878 0.78664830 g0 logit 0.03070319 0.001233304 0.02837595 0.03321478 sigma log 192.09731037 8.033758603 176.98582425 208.49905244

Once I try to add the trapping effort, for which I created a matrix, all values of the density calculation turn to NA:

> Trapping_effort <- subpkg$data$deployments %>% + mutate(Detector = as.character(gsub("[^0-9]", "", locationName))) %>% + arrange(Detector) %>% + cameraOperation(stationCol = "Detector", + setupCol = "start", + retrievalCol = "end", + dateFormat = "%Y-%m-%d %H:%M:%S") %>% + {colnames(.) <- paste0(1:134); .} %>% + {.[is.na(.)] <- 0; .} > # b) Add matrix to 'capthist' object. > usage(traps(capthist_cat_o)) <- Trapping_effort > summary(traps(capthist_cat_o)) Object class traps Detector type proximity Detector number 79 Average spacing 673.2793 m x-range 2677614 2688170 m y-range 1242697 1253756 m Usage range by occasion 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 min 0.0000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 max 0.5939 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 min 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 max 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 122 123 124 125 126 127 128 129 130 131 132 133 134 min 0 0 0 0 0 0 0 0 0 0 0 0 0.0000 max 1 1 1 1 1 1 1 1 1 1 1 1 0.5099 Warning: In subset.capthist(x, OK, ...) : no detections on occasion(s) 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 26, 28, 36, 37, 38, 39, 41, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 82, 83, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134 > # 5. Estimate animal population density with data from an array of passive detectors (traps) by fitting a spatial detection model by maximizing the likelihood. > fit <- secr.fit(capthist = capthist_cat_o, + trace = FALSE, + verify = TRUE) Warning: using default buffer width 100 m > fit secr.fit(capthist = capthist_cat_o, verify = TRUE, trace = FALSE) secr 4.6.6, 12:31:22 14 Apr 2024 Detector type count Detector number 79 Average spacing 673.2793 m x-range 2677614 2688170 m y-range 1242697 1253756 m Usage range by occasion 1 min 7.4450 max 32.3841 N animals : 173 N detections : 722 N occasions : 1 Count model : Binomial, size from usage Mask area : 259.854 ha Model : D~1 g0~1 sigma~1 Fixed (real) : none Detection fn : halfnormal Distribution : poisson N parameters : 3 Log likelihood : -1e+10 AIC : 2e+10 AICc : 2e+10 Beta parameters (coefficients) beta SE.beta lcl ucl D NA NA NA NA g0 NA NA NA NA sigma NA NA NA NA Variance-covariance matrix of beta parameters NULL Fitted (real) parameters evaluated at base levels of covariates link estimate SE.estimate lcl ucl D log NA NA NA NA g0 logit NA NA NA NA sigma log NA NA NA NA

Does anyone have an idea why secr.fit() can't calculate the population density anymore?
Thanks for the help.
Sincerely, Ide

Murray Efford

unread,
Apr 14, 2024, 6:19:44 PMApr 14
to secr
Hi Ide
It's hard to see what is going on. You used the default 100 m buffer, which is clearly inadequate unless the habitat is an island. If fixing that doesn't work then I suggest you send me the data and code offline so I can check.
Murray

Murray Efford

unread,
Apr 19, 2024, 7:06:36 PMApr 19
to secr
Hi again
Thanks for sending data. It seems that, despite having a lot of data, you have just one instance of an individual moving between detectors. I would conclude your data are insufficient for spatial capture-recapture analysis. Sorry about that. If you had anticipated that you could have designed the study differently (grouping cameras so that some inter-camera distances were shorter). An ad hoc 'solution' is to fix the spatial parameter sigma at some value based on the literature or whatever, but that will not be very convincing and the confidence intervals will not include uncertainty regarding sigma.

fitfix <- secr.fit(tcapthistcat, buffer = 600, fixed = list(sigma = 80)
predict(fitfix) link estimate SE.estimate lcl ucl D log 0.1715282 0.013590367 0.14689244 0.2002957 g0 logit 0.1066106 0.007397095 0.09295656 0.1220005

Murray
Reply all
Reply to author
Forward
0 new messages