add telemetry, covariates, NA likelihood

209 views
Skip to first unread message

Darcy Doran-Myers

unread,
Jan 28, 2018, 9:31:15 PM1/28/18
to secr
Hi all, 

I am running into two problems while attempting to add telemetry data to a hair snare trapping dataset. The hair snare dataset has 1 session, 8 occasions, 36 detectors, 41 individuals detected a total of 77 times. The concurrent telemetry dataset includes 11 telemetered individuals, 8 of which were detected on hair snares, with 329-5149 locations per animal (app. 26,000 points total). Telem data were collapsed to a single session. 

My two problems are: 
1) On using addTelemetry, I get a warning that the covariates in the telemetry CH do not match the detection CH. The detection CH included sex covariates. I attempted to add a 'sex' column (M/F) to the telemetry txt file but got the same error. Is there a way to include sex covariates and telem data? I have not found documentation on this. 

#In addTelemetry(HSjanapr17, HStelem17, type = c("concurrent"), #collapsetelemetry = TRUE,  :
  #covariates in telemetryCH do not match detectionCH so covariates discarded

If I move forward anyway, I run into:
2) A returned likelihood NA when I call secr.fit. In line with suggestions from the 'Telemetry data in secr 3.0' vignette, I have tried triple checking the telem file for location errors, changing the detection function to HEX, scaling telemetry data between 1e3 to 1e12, and including trace=TRUE and details = list(debug=1) .... none of which have budged it. Initial  values for D, g0, and sigma seem reasonable to me. 
It appears that the problems start from the beginning: 

#Initial values  D = 0.00232, g0 = 0.13603, sigma = 1159.68168 
#Maximizing likelihood... 
#Eval     Loglik  lambda0    sigma 
#secrloglik resultcode  9   non-finite value in secrloglik 
#Likelihood components 9.3464 -398.7629 0 0 0 0 
 #  1         NA  -1.9226   7.0559 
.....
Warning messages:
1: In FUN(X[[i]], ...) :
  zero likelihood with telemetry data suggests numerical problem - try larger telemetryscale


Thanks in advance for any and all help in navigating these problems! 
Below are relevant code and the three input files, if helpful in diagnosing. 

Darcy 


HSjanapr17 <- read.capthist("hs_janapr17_caps.txt", "hs_janapr17_traps.txt", detector = "multi", covnames = "sex")

HSMask <- make.mask(traps(HSjanapr17), buffer = 10000, spacing=500, type = c("trapbuffer"), poly = nonHab, poly.habitat = FALSE)

HStelem17<-read.telemetry(file = "telemdataHS172.txt") 

HSjanapr17telem<-addTelemetry(HSjanapr17, HStelem17, type= c("concurrent"), collapsetelemetry =TRUE, verify=TRUE)

HS17fit1<-secr.fit(HSjanapr17telem, mask = HSMask, detectfn = 'HHN', CL=TRUE, details = list(debug = 1), trace = TRUE)

--
Darcy Doran-Myers
University of Alberta
Biological Sciences- Ecology
hs_janapr17_caps.txt
hs_janapr17_traps.txt
telemdataHS172.txt

Murray Efford

unread,
Jan 29, 2018, 1:37:15 AM1/29/18
to secr
Hi
The first question has an easy answer - just add the covariates with e.g.,
covariates(HStelem17)covariates(HStelem17) <- data.frame(sex =
    covariates
(HSjanapr17)$sex[match(rownames(HStelem17), rownames(HSjanapr17))])
covariates
(HStelem17)$sex[is.na(covariates(HStelem17))] <- 'F' # Bonnie, Thelma, Louise
CH
<- addTelemetry(HSjanapr17, HStelem17)

The second has me stumped. Probably the theory for combining telemetry and SECR needs more work when there is such a large imbalance between  the capture-recapture and telemetry data. The telemetry data probably would make a small reduction in the precision of capture-recapture estimates (fixing sigma in the SECR model shifts RSE(Dhat) from 20% to 17%). I suspect the core problem is that a random effects model is needed to encompass the between-individual home range differences. Note the differences in sigma-hat among individuals
ch <- split(HStelem17, rownames(HStelem17))
sapply
(ch, RPSV, CC=TRUE)
# Bonnie       L10       L11       L12       L23        L3       L35       L36        L7
# 1104.1223  982.9444 1605.6808 1288.5057 1064.7850 2031.9366 1149.8753 1275.9258 1250.4472
# Louise    Thelma
# 2214.7050  919.2703

Murray

Murray Efford

unread,
Jan 29, 2018, 1:38:57 AM1/29/18
to secr
Of course I meant reduction in RSE, improvement in precision
Murray

Darcy Doran-Myers

unread,
Jan 29, 2018, 4:57:41 PM1/29/18
to Murray Efford, secr
Hi Murray, 

Thanks for your quick response. The first question has been resolved using a modified version of the code you provided. Do you have a quick way to check that the sex covariate was added correctly? It goes through without a warning now, I am just looking for a way to double check. 

covariates(HStelem17) <- data.frame(sex = covariates(HSjanapr17)$sex[match(rownames(HStelem17), rownames(HSjanapr17))])
covariates(HStelem17)$sex[is.na(covariates(HStelem17))] <- 'F'

Regarding the second question - I see what you mean by heterogeneity in sigma between individuals. It seems, however, that this would be expected for many natural populations being sampled this way. I am struggling to find a way around this. I reduced all telem data to 200 points per individual and ran it again, but 1) the sigma of each animal was greatly reduced, and therefore not representative of their true home ranges and 2) the likelihood immediately went to NA the same as before when model fitting. 

Is there a random effects model that you suggest I try? 

Would it be possible/ useful to fix sigma for my model as the average sigma of individuals from telem data, without actually pulling in the raw telemetry data? 

It's possible that this just is not a useful addition for my dataset, and if so that's fine. It's tough to have the extra info and not use it, though! 

Darcy 

--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Murray Efford

unread,
Jan 29, 2018, 6:16:34 PM1/29/18
to secr
How about covariates(CH)?

You're right that the telemetry problem is systemic. It's no trouble to fix sigma at the telemetry mean - that's how I got RSE 17%; look for the 'fixed' argument.

There's no canned ML random effects model I know of. It's now on my to do list. You're welcome to write some BUGS code, but I don't promise it will be worth the effort.

Murray

Chris Sutherland

unread,
Jan 29, 2018, 6:32:26 PM1/29/18
to Murray Efford, secr
Hi Darcy,

FWIW, here is some JAGS code for the integration. We tried to offer an approach to test for consistency in sigma from scr and telemetry data:


Also, Linden et al do something similar here:


Chris

Darcy Doran-Myers

unread,
Jan 30, 2018, 2:26:09 PM1/30/18
to Chris Sutherland, Murray Efford, secr
Thanks for the help, Murray and Chris. Very much appreciated. For my purposes, I am happy with fixing sigma at the mean sigma across telemetered individuals in order to increase precision. I plan to do the same for concurrent data applied in a camera trap mark-resight model. 

Darcy 
Reply all
Reply to author
Forward
0 new messages