secr 3.1.6 - addTelemetry and mark resight

questions concerning anlysis/theory using program DENSITY and R package secr. Focus on spatially-explicit analysis.

secr 3.1.6 - addTelemetry and mark resight

Postby Mateo » Fri Sep 28, 2018 12:37 pm

I am using secr 3.1.6 (and R 3.5.1). The secr-markresight documentation (dated 2018-2-23) says mark-resight models are "intended" to work with addTelemetry, although this is "poorly tested."

I am able to get addTelemetry to run with mark-recapture data, but when I try mark-resight data, I get an error message. Is my code wrong, or is this simply not going to work? See below.

Code: Select all
# sim mark-recap data
grid.mr <- make.grid()
pop <- sim.popn(grid.mr, D = 10)
simCap <- sim.capthist(grid.mr, detectpar = list(lambda0 = 0.1, sigma = 20),
                       popn = pop, renumber = FALSE, detectfn = "HHN")

# sim telemetry data
tel <- make.telemetry()
popTel <- subset(pop, sample.int(nrow(pop), 10))
simTel <- sim.capthist(tel, popn = popTel, renumber = FALSE, detectfn = "HHN",
                      detectpar = list(sigma = 20), noccasions = 1, exactN = 5)

# sim mark-resight data
grid.rs <- make.grid(detector = c("multi", rep("count",4)),
                      markocc = c(1, rep(0, 4)))
simSight <- sim.resight(grid.rs, detectpar=list(g0 = c(0.3, rep(0.1, 4)),
                 sigma = 20), popn = pop, renumber=F, pID = 0.7)

# addTelemetry
MRdata <- addTelemetry(simCap, simTel, type = 'concurrent')    # OK
RSdata <- addTelemetry(simSight, simTel, type = 'concurrent')  # error

# Error in `usage<-`(`*tmp*`, value = newusge) :
#    replacement value not compatible with existing markocc attribute
Mateo
 
Posts: 13
Joined: Thu Oct 01, 2009 10:56 am
Location: Georgia

Re: secr 3.1.6 - addTelemetry and mark resight

Postby murray.efford » Sat Sep 29, 2018 7:59 pm

Hi Mateo

You're right: The version of addTelemetry in the published version of the package does not perform as promised - it stumbles on the markocc attribute and ignores resight data. Thanks for providing a concise reproducible example.

I have a patch for this in my working code, but I don't have time or enthusiasm for further testing. I have other doubts about the value of combining telemetry and capture-recapture, it is hard to get these models to fit at all, and I don't have a real test dataset. So I'm torn between removing the capability altogether and publishing the patched version. Within the next hour or so I'll post a pre-release version with the patch so you can have a look. Watch this space.

Murray
murray.efford
 
Posts: 686
Joined: Mon Sep 29, 2008 7:11 pm
Location: Dunedin, New Zealand

Re: secr 3.1.6 - addTelemetry and mark resight

Postby murray.efford » Sat Sep 29, 2018 8:20 pm

Here is a tentatively patched version -

https://www.otago.ac.nz/density/zip/secr_3.1.7.zip Windows binary
https://www.otago.ac.nz/density/zip/secr_3.1.7.tar.gz Source (needs compilation)
murray.efford
 
Posts: 686
Joined: Mon Sep 29, 2008 7:11 pm
Location: Dunedin, New Zealand

Re: secr 3.1.6 - addTelemetry and mark resight

Postby Mateo » Mon Oct 01, 2018 7:38 pm

Thanks so much for the advice. I downloaded 3.1.7, and the results were as you predicted. addTelemetry did combine the resight and telemetry data (with a warning about covariates). After a few sims, one run did not converge, and other runs had better estimates WITHOUT telemetry data.
For example, with set.seed(1), and the previous simulation code (D=10, sigma=20), secr.fit without telemetry data estimated:
Code: Select all
> fitM1 <- secr.fit(simSight, model = list(g0 ~ ts), mask = mask, trace = FALSE)
> predict(fitM1, newdata = data.frame(ts = factor(c("M","S"))))
$`ts = M`
       link   estimate SE.estimate        lcl        ucl
D       log 26.6784659  5.14464585 18.3447630 38.7980233
g0    logit  0.2789785  0.07994518  0.1507788  0.4574623
sigma   log 20.2685665  2.71407215 15.6080453 26.3207072
pID   logit  0.6215685  0.08979306  0.4373353  0.7763299


And with telemetry data estimated:
Code: Select all
fitM2 <- secr.fit(RSdata, model = list(g0 ~ ts), mask = mask, trace = FALSE,
+                   details = list(telemetryscale = 1e12))
> predict(fitM2, newdata = data.frame(ts = factor(c("M","S"))))
 $`ts = M`
         link    estimate SE.estimate        lcl         ucl
D         log 29.29868756 6.037669172 19.6453188 43.69555418
lambda0   log  0.03231474 0.008453401  0.0195166  0.05350532
sigma     log 75.15513124 7.005137521 62.6311633 90.18343993
pID     logit  0.55834020 0.094416741  0.3737876  0.72807124


I was surprised that telemetry data did not help, given Sollman et al. 2013 (Ecology 94:553-559) reported that models only converged after adding telemetry data. Is that a quirk of the data? Or maybe due to their Bayesian approach?
Mateo
 
Posts: 13
Joined: Thu Oct 01, 2009 10:56 am
Location: Georgia

Re: secr 3.1.6 - addTelemetry and mark resight

Postby murray.efford » Mon Oct 01, 2018 8:14 pm

I can't add much. Remember that telemetry data, at best, improves the estimate of sigma, and in your example that is already good - precision is determined by other things. You can test the potential benefit by fixing sigma at the known true value.

The Sollmann et al. paper is quirky because habitat and home ranges were linear (along the beach) and camera spacing was very wide. There was also something else odd going on in the mark-resight analysis that I never got to the bottom of (estimated density is surprisingly independent of sigma when it is fixed across a wise range of values).
murray.efford
 
Posts: 686
Joined: Mon Sep 29, 2008 7:11 pm
Location: Dunedin, New Zealand

Re: secr 3.1.6 - addTelemetry and mark resight

Postby murray.efford » Mon Oct 01, 2018 9:34 pm

I was a little too dogmatic in that last post - telemetry sometimes has other benefits, usually marginal.
murray.efford
 
Posts: 686
Joined: Mon Sep 29, 2008 7:11 pm
Location: Dunedin, New Zealand

Re: secr 3.1.6 - addTelemetry and mark resight

Postby Mateo » Mon Oct 01, 2018 10:36 pm

I am not trying to be a pest, but I am interested in telemetry data because I have a large study area (50,000 km2), and so I am considering widely spaced cameras. In that case, I would expect few (zero?) animals captured at multiple cameras, making it difficult to estimate sigma (and D). Does it seem reasonable to use RPSV and then secr.fit with just resight data? In the example below, animals are never sighted in two locations, but with a pretty large sample, it gives pretty decent results

Code: Select all
### Sim mark-resight
set.seed(123)
sight.sessions <- 4
grid <- make.grid(nx = 5, ny = 5, spacex = 45, spacey = 45, spacing = NULL,
                  detector = c("multi", rep("count",sight.sessions)), originxy = c(0,0), hollow = F,
                  ID = "alphay", markocc = NULL)

pop2 <- sim.popn(grid, D = 160, buffer = 0)

# sim capture histories
markocc(grid) <- c(1, rep(0, sight.sessions))
g0mr <- c(0.9, rep(0.3, sight.sessions))  # first value is capture.
simMS <- sim.resight(grid, detectpar=list(g0 = g0mr, sigma = 8),
                       popn = pop2, pID = 1)
plot(grid)
plot(simMS, title = 'Photos', tracks = TRUE, add = T)
#### animals not caught at multiple locations

# attempt to fit data
mask <- make.mask(traps(simMS), nx = 32, buffer = 0)
fitM1 <- secr.fit(simMS, model = list(g0 ~ ts), mask = mask, trace = FALSE)
#### model does not converge


# Sim telemetry data
tel <- make.telemetry()
popTel <- subset(pop2, sample.int(nrow(pop2), 20))
simTel <- sim.capthist(tel, popn = popTel, renumber = FALSE, detectfn = "HHN",
                       detectpar = list(sigma = 8), noccasions = 1, exactN = 10)

# use RPSV to estimate sigma and fit data again
rpsv.sigma <- RPSV(simTel, CC = TRUE)
ostart <- c(log(160), log(.3), log(0.1), .9)
fitM2 <- secr.fit(simMS, model = list(g0 ~ ts), mask = mask, trace = FALSE,
                  fixed = list(sigma = rpsv.sigma), start=ostart)
predict(fitM2, newdata = data.frame(ts = factor(c("M","S"))))
#### now model converges
Mateo
 
Posts: 13
Joined: Thu Oct 01, 2009 10:56 am
Location: Georgia

Re: secr 3.1.6 - addTelemetry and mark resight

Postby murray.efford » Tue Oct 02, 2018 1:03 am

Your efforts to simulate the design are commendable! I can offer opinions, but it’s up to you to decide how much weight to give them.

The possibility of combining data from widely separated, effectively independent, detectors and an external estimate of the detection function has always been latent in SECR. The rigorous way to do this is to assign some field effort to estimating the detection function in situ (e.g., using recaptures within clusters of detectors). We have done this in an unpublished acoustic study.

Importing an estimate of sigma requires that it strictly match the re-capture or re-sight sigma. This won’t hold if the temporal scale differs (the old difference between e.g. daily and monthly home range) or telemetry uses a biased sample of the population.

Importing constant sigma also precludes healthy compensation between sigma and lambda0 if there is individual variation (Efford & Mowat 2014 Ecology 95:1341-8). I would expect results to be less robust.

I don’t see how you include uncertainty in sigma-hat in your example (of course if I was right originally this component may be negligible).

[On the side - counting re-sightings is often impractical - you never know when they are independent. Better to use binary data at the level of individual x detector x occasion.]

I’m way out on a limb by now… The limits to combining data types need some serious research.
Murray
murray.efford
 
Posts: 686
Joined: Mon Sep 29, 2008 7:11 pm
Location: Dunedin, New Zealand

Re: secr 3.1.6 - addTelemetry and mark resight

Postby Mateo » Tue Oct 02, 2018 12:45 pm

Lots to think about. Thanks for the input!
Mateo
 
Posts: 13
Joined: Thu Oct 01, 2009 10:56 am
Location: Georgia


Return to analysis help

Who is online

Users browsing this forum: No registered users and 9 guests