difference between secr and openCR

83 views
Skip to first unread message

Rafael custódio

unread,
Nov 30, 2021, 8:48:49 AM11/30/21
to secr
Hi Murray and all,

I am having a bit of trouble explaining the density results with openCR and secr. If I run both functions to the same dataset I do obtain different results that are consistently off by 10fold. 

summary(data,terse=TRUE) # summary of my data
# Occasions Detections    Animals  Detectors
  #      59        158         32         41

#Run secr null:
mask1<-read.mask(data=mask, spacing = 500, header=TRUE)
secr0=secr.fit(data, model=list(g0~1, sigma~1),mask=mask1,trace=FALSE,verify=FALSE)
predict(secr0)
#       link    estimate  SE.estimate          lcl          ucl
#D       log 2.00868e-04 3.994655e-05 1.365436e-04 2.954950e-04
#g0    logit 1.72702e-02 2.258178e-03 1.335879e-02 2.230098e-02
#sigma   log 5.97278e+03 5.317174e+02 5.018213e+03 7.108924e+03

#run openCR:
data2=reduce(data,by="all")
fit<- openCR.fit(data2,mask=mask1,type="JSSAsecrb")
predict(fit)
#$lambda0
 # session    estimate SE.estimate         lcl         ucl
#1       1 0.003594342           0 0.003594342 0.003594342
$phi
  session estimate SE.estimate lcl ucl
1       1       NA          NA  NA  NA
$b
  session estimate SE.estimate lcl ucl
1       1        1          NA   1   1
$superD
      estimate SE.estimate          lcl          ucl
1 2.483975e-05           0 2.483975e-05 2.483975e-05
$sigma
  session estimate SE.estimate      lcl      ucl
1       1 6620.637           0 6620.637 6620.637

(this happens to several datasets I am testing always in the same order of difference)

Interestingly, by mistake one time I was running openCR I forced the spacing when calling the mask to be half of it actually is (so in this case if I use the 1km spaced mask but when loading it I specify spacing=500) then I have a much similar result with secr (secr using the correct mask with correct spacing): 
mask2<-read.mask(data=mask, spacing = 250, header=TRUE) # mask here is the same file as before just spacing =250 differs
fit2<- openCR.fit(data2,mask=mask2,type="JSSAsecrb")#Spatial
predict(fit2)
$lambda0
  session    estimate SE.estimate         lcl         ucl
1       1 0.003534561           0 0.003534561 0.003534561
$phi
  session estimate SE.estimate lcl ucl
1       1       NA          NA  NA  NA
$b
  session estimate SE.estimate lcl ucl
1       1        1          NA   1   1
$superD
      estimate SE.estimate          lcl          ucl
1 0.0001155695           0 0.0001155695 0.0001155695
$sigma
  session estimate SE.estimate     lcl     ucl
1       1  7949.61           0 7949.61 7949.61

Plus, the non-spatial super N estimated with openCR gives 53 which divided by the correct sized area (283575ha) is roughly the secr estimated density (0.000187 ind/ha).
I am sorry if I am missing something obvious here but is there any difference in the units of D between openCR and secr?

Thank you so much!
Rafael

Murray Efford

unread,
Nov 30, 2021, 12:29:58 PM11/30/21
to Rafael custódio, secr
I've only taken a quick look, but your openCR model has a problem (SE 0 for superD). Also, superD is cumulative across time, so generally should not be compared to time-specific density.

reduce(data, by='all') collapses data to a capthist object of the same detector type on a single occasion, which in the case of binary proximity detectors results in (large) loss of information. Perhaps this is why openCR fails. You may want to specify outputdetector = 'count'; then with binomN = 1 openCR.fit() fits a binomial model to the resulting counts (size of binomial from usage attribute). (You could try that also in secr).

I indicated earlier my distaste for using openCR to estimate density. There may be times when it's needed, but there are many more things that can go wrong. You are modelling or making assumptions about not just phi but also recruitment and movement between sessions (activity centres probably not static), and any of these may vary over time. Subtle breaches of assumptions (e.g. unmodelled heterogeneity) can generate patterns over time (historically , for nonspatial JS, downturns either end).

--
You received this message because you are subscribed to the Google Groups "secr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to secrgroup+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/secrgroup/9cd25fd4-e2ff-4ee8-b33e-9caeae28e01cn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages