Questions re understanding the effective sampling area (esa) in package ‘secr’

145 views
Skip to first unread message

laurak

unread,
Jul 20, 2017, 4:40:24 PM7/20/17
to secr

Hello,


I’m new to SECR modelling, and am trying to understand how effective sampling areas (esa) are calculated. Many thanks in advance for any insights you can provide! I’ve tried to explain my current level of understanding below, and have highlighted questions in bold.


From the Borchers and Efford 2008 paper, it seems that in the simple case where density (D) is constant and there are no covariates, the esa for each trap is the integral of the capture function (i.e. the equation for 'a' on page 379). Am I understanding that correctly?


Using the example hare dataset available in package ‘secr’ and leveraging the corresponding tutorial example, I wrote the following R code to calculate the integral of a half-normal capture function:


hareCH6 <- read.capthist("Data/hareCH6capt.txt", "Data/hareCH6trap.txt", detector = "single")


initialsigma <- RPSV(hareCH6, CC = TRUE)


fit.HN <- secr.fit (hareCH6, buffer = 4 * initialsigma, detectfn = 'HN', trace = FALSE)

logit2prob <- function(logit){ # from https://sebastiansauer.github.io/convert_logit2prob/

  odds <- exp(logit)

  prob <- odds / (1 + odds)

  return(prob)

}

 

g0_logit <- coef(fit.HN)$beta[2]

g0_prob <- logit2prob(g0_logit)

 

sigma_log <- coef(fit.HN)$beta[3]

sigma_prob <- exp(sigma_log)

 

d <- seq(from = 0, to = 200, by = 1) # distance in m

 

capture_function <- function(d){

  P <- g0_prob*exp(-(d^2)/(2*sigma_prob^2)) # see page 49 of the secr manual for this formula

  return(P)

}


plot(d, capture_function(d)) # graph of the function as calculated by me above

plot(fit.HN, xval = 0:200) # graph of the function as generated automatically - good news, they match!


area_under_capture_function_curve_m2 <- integrate(capture_function, lower = 0, upper = Inf)


For the example hare dataset, this gives me: area_under_capture_function_curve_m2 =  5.275324 with absolute error < 4.6e-06.

 

I also noticed that the package ‘secr’ can calculate the esa directly, but presumably this is the esa for the entire trapping area (not just one trap). Am I correct in thinking that the esa calculated by the R package ‘secr’ is for the entire trapping area?


Again using the example hare dataset, I wrote the following R code to estimate the entire trapping area:


esa_all_traps_hectares <- derived(fit.HN)$estimate[1]


This gives me an esa of 46.38597 hectares.
 
How does this esa for the entire trapping area work, and how is it related to the ‘area under the capture function curve’ approach (i.e. where I got ~5m2 for each trap)?

On a separate but related note, would it be appropriate to look at the capture function curve and take the distance that corresponds with 95% of the area under the curve as an estimate of the radius of the effective sampling area for each trap assuming it is a circle?


A huge thanks again in advance for your help!


Much appreciated,


Laura

murray.efford

unread,
Jul 20, 2017, 6:48:25 PM7/20/17
to laurak, secr
Hi Laura
I think you're integrating the wrong fn. You want what 'secr' calls pdot (x) - the probability that an animal at x is detected by at least one detector. See ?pdot; summing pdot values and scaling by cell size gives you esa. Note D-hat = n/esa where n is number of different individuals.
Murray

P.S. try ?invlogit

Sent from my Samsung Galaxy smartphone.
--
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.
For more options, visit https://groups.google.com/d/optout.

David Borchers

unread,
Jul 21, 2017, 9:58:14 AM7/21/17
to secr
To answer your questions in bold:

(1) The equation for 'a' on page 379 is the integral of the capture function, but note that it is the integral for the combined capture function of all traps over all occasions. A per-trap esa could be obtained by integrating the capture function for a single trap (combined over all occasions), as I think you suggest. If you integrated the capture function for a single occasion, you'd get an "esa" for a single trap on a single occasion, not for a single trap over the whole survey (unless the survey involved only one occasion - and I think you do have only one occasion, and that this is what you have done).

(2) Yes, you are correct in thinking that "
the esa calculated by the R package ‘secr’ is for the entire trapping area" - presuming that you mean "for all traps combined" when you say "for the entire trapping area".

(3) How does this esa for the entire trapping area work, and how is it related to the ‘area under the capture function curve’ approach (i.e. where I got ~5m2 for each trap)?

The esa for all traps combined is as per the equation for a on page 379, where the integrand is what secr calls pdot(x), which is given by the equation on the second line of page 379.

Assuming that there is only one occasion, the relationship between this a and the per-trap esa is just that the esa for all traps combined integrates over {1 - product_k [1-p_k(x)]} (i.e. the probability that at least one trap detects an animal with activity centre at x) whereas the per-trap esa integrates over p_k(x) (i.e. the probability that the kth trap detects an animal with activity centre at x).

(4) On a separate but related note, would it be appropriate to look at the capture function curve and take the distance that corresponds with 95% of the area under the curve as an estimate of the radius of the effective sampling area for each trap assuming it is a circle?

No, that is not correct. The detection function is not a probability density function. But it is easy to calculate what I think you might want: the "effective radius" of a single trap would be the square root of [the per-trap esa divided by pi] (from the formula for the area of a circle: a = pi*r^2). This gives the radius within which you would expect to make as many detections as expected from your detection function, if you detected everything with activity centres within this radius and nothing beyond it. (I don't know if you were thinking this, but advise you to avoid the temptation to think in terms of some fixed radius within which you detect stuff and beyond which you don't - that is not the way that the detection process works.)

Finally, note that all of the above refers to the case in which density is assumed constant. The concept of an esa falls apart a bit when you have non-uniform density. (You can generalise it for that case, but its interpretation is then not as intuitive.)

Laura Keating

unread,
Jul 21, 2017, 7:01:52 PM7/21/17
to murray.efford, secr

Hi Murray,

 

Thanks so much for the quick and very helpful response! Yes, you’re right that pdot is what I was looking for. I tried using pdot with various grid extents and cell sizes and was able to get fairly close to the same output as the esa function, so am feeling more confident now that I understand what the esa function is doing.

 

Much appreciated,

 

Laura

 

 

 

Thank you for supporting wildlife conservation,

Laura Keating
Conservation Research Analyst

T

1300 Zoo Road NE
Calgary, AB T2E 7V6
calgaryzoo.com

As a not-for-profit charitable institution, the Calgary Zoo is a conservation leader whose mission is to take and inspire action to sustain wildlife and wild places.

Please think of the environment before printing this e-mail.
This email may contain confidential and/or privileged information for the sole use of the intended recipient. Any review or distribution by others is strictly prohibited. If you have received this email in error, please contact the sender immediately and delete all copies.

Laura Keating

unread,
Jul 25, 2017, 11:49:03 AM7/25/17
to David Borchers, secr

Thank you David – very helpful!!!

 

Much appreciated,

 

Laura

 

Thank you for supporting wildlife conservation,

Laura Keating
Conservation Research Analyst

T

1300 Zoo Road NE
Calgary, AB T2E 7V6
calgaryzoo.com

As a not-for-profit charitable institution, the Calgary Zoo is a conservation leader whose mission is to take and inspire action to sustain wildlife and wild places.

Please think of the environment before printing this e-mail.
This email may contain confidential and/or privileged information for the sole use of the intended recipient. Any review or distribution by others is strictly prohibited. If you have received this email in error, please contact the sender immediately and delete all copies.

From: secr...@googlegroups.com [mailto:secr...@googlegroups.com] On Behalf Of David Borchers
Sent: Friday, July 21, 2017 7:58 AM
To: secr <secr...@googlegroups.com>
Subject: Re: Questions re understanding the effective sampling area (esa) in package ‘secr’

 

To answer your questions in bold:

--

Reply all
Reply to author
Forward
0 new messages