Discrepancies between secr and openCR estimates for closed pop. models

50 views
Skip to first unread message

Matt Rees

unread,
Jul 17, 2019, 2:08:14 AM7/17/19
to secr
Using both my own data and a test dataset, there appears to be some pretty big discrepancies between parameter estimates for, as far as I can tell, the same closed population model using secr.fit and openCR.fit packages. 

Using the OVpossumCH dataset as an example:


# load data etc 
ovtrap <- traps(OVpossumCH[[1]])
datadir <- system.file("extdata", package = "secr")
OVforest <- rgdal::readOGR(dsn = datadir, layer = "OVforest")
ovmask <- make.mask(ovtrap, buffer = 120, type = 'trapbuffer', poly = OVforest[1:2,], spacing = 15, keep.poly = FALSE)
intervals(OVpossumCH) <- c(123, 91, 154, 118, 85)/365 # annual


# fit closed pop model using opencr
closed_opencr <- openCR.fit(OVpossumCH, mask = ovmask, detectfn = "HHR", type = 'secrD')
# massage the predict.openCR results to the same format as predict.secr
pred_closed_opencr <- plyr::rbind.fill(predict(closed_opencr))[c(2,1,3),-1] 
rownames(pred_closed_opencr) <- secr$realnames


# fit closed pop model using secr
closed_secr <- secr.fit(OVpossumCH, mask = ovmask, detectfn = "HHR")

# compare the estimates
predict(closed_secr).    
pred_closed_opencr


closed_secr gives a D estimate of: 10.1187047
closed_opencr gives a D estimate of: 14.2337598



The difference is much greater in my own dataset. 
Perhaps I am I missing something obvious (wouldn't be the first time...) - are these models not doing the same thing? 


Any thoughts would be greatly appreciated group/Murray!

Cheers,
Matt. 

Murray Efford

unread,
Jul 23, 2019, 4:29:36 AM7/23/19
to secr
openCR collapses whatever data you give it to a single 'session' and applying a single closed population model makes no sense for the multi-session OVpossumCH dataset. If we instead select a single session and compare that the results are acceptably close:

closed_opencr1 <- openCR.fit(OVpossumCH[[1]], mask = ovmask, detectfn = "HHR", type = 'secrD')
closed_secr1
<- secr.fit(OVpossumCH[[1]], mask = ovmask, detectfn = "HHR")

# compare the estimates
predict
(closed_secr1)    
#         link   estimate SE.estimate        lcl       ucl
# D        log 14.4546241  1.01152646 12.6041316 16.576799
# lambda0  log  0.0944063  0.01203863  0.0736027  0.121090
# sigma    log 31.9528650  2.81687805 26.8915211 37.966822
# z        log  4.5982148  0.45650172  3.7869604  5.583259

pred_closed_opencr1
<- plyr::rbind.fill(predict(closed_opencr1))[c(2,1,3,4),-1]
rownames
(pred_closed_opencr1) <- rownames(predict(closed_secr1))
pred_closed_opencr1
#            estimate SE.estimate         lcl        ucl
# D       14.45463269  1.01029164 12.60413966 16.5768083
# lambda0  0.09440643  0.01199018  0.07360273  0.1210903
# sigma   31.95284421  2.81143900 26.89148236 37.9668268
# z        4.59821430  0.45538433  3.78695749  5.5832617


Matt Rees

unread,
Jul 24, 2019, 5:23:00 AM7/24/19
to secr
Ah yep, makes total sense. Thank so much for clearing that up Murray!
Reply all
Reply to author
Forward
0 new messages