Thanks, Murray. That is the same approach I took in a different project and it worked great. I hadn't made the leap to simulating capture histories like that, and your example was very helpful. I'm still not sure I can easily use this with secrdesign, but it is relatively easy to manually code up my own simulations and fit multiple capture histories directly with secr.fit.
Everything runs without a hitch using a single detector type, but what I really have are 2 different detector types: a baited corral with a detector type of "count", and a single-catch hair snare, with a detector type of "capped". Actually, I'll have a third (rubtree, detector = "count"), but that's for later. I've used designs with multiple detector types before (count and multi) with no problems, but this time I am receiving the following error:
- Code: Select all
> summary(traps2.all)
Object class traps
Detector type count, capped, count, capped, count, capped, count, capped
Detector number 253
Average spacing 3277.859 m
x-range 620000 745000 m
y-range 795024 875000 m
Usage range by occasion
1 2 3 4 5 6 7 8
min 0 0 0 0 0 0 0 0
max 10 10 10 10 10 10 10 10
> ch <- sim.capthist(traps2.all, popn=list(D=densities[4], buffer=100), noccasions = 8,
detectpar = list(sigma = rep(c(sigma.yak, sigma.snare), 4),
g0 = rep(c(g0.yak, g0.snare), 4)))
> summary(ch)
Object class capthist
Detector type count, capped, count, capped, count, capped, count, capped
Detector number 253
Average spacing 3277.859 m
x-range 620000 745000 m
y-range 795024 875000 m
Usage range by occasion
1 2 3 4 5 6 7 8
min 0 0 0 0 0 0 0 0
max 10 10 10 10 10 10 10 10
Counts by occasion
1 2 3 4 5 6 7 8 Total
n 60 43 55 44 64 36 60 32 394
u 60 41 38 32 34 26 28 20 279
f 189 67 21 2 0 0 0 0 279
M(t+1) 60 101 139 171 205 231 259 279 279
losses 0 0 0 0 0 0 0 0 0
detections 70 44 58 47 71 37 69 32 428
detectors visited 47 44 43 47 53 37 43 32 346
detectors used 81 172 81 172 81 172 81 172 1012
> fit <- secr.fit(ch, model = list(g0 ~ type, sigma ~ type), mask = mask, detectfn = 0)
Error in reduce.capthist(capthist, outputdetector = "count", by = "all") :
reduce.capthist does not yet handle mixed input detector types
I didn't get that in a previous study that also used mixed detector types. I suppose it isn't a big deal to set them all to "count" detectors. The single-use hair snags only allow a single detection, but doesn't restrict movement, so "capped" seemed more appropriate. Can I bypass that reduce.capthist step, or do you think the difference between "count" and "capped" isn't all that important if I'm also using a "trap type" covariate?