empirical.varD

246 views
Skip to first unread message

Eric H

unread,
Dec 10, 2018, 2:43:11 PM12/10/18
to secr
Good day,

We sample bears at baited hair corrals. We have many trap arrays across our jurisdiction, with 2 - 7 arrays within each of several "Wildlife Zones". Arrays are far enough apart that we treat them as independent (sets of individuals do not intersect).  Arrays all use similar numbers of traps at similar spacing, but vary in shape and extent because we access most trap sites using secondary roads, which are not on a regular grid. Furthermore, some arrays are closer than others to large waterbodies, and we exclude open water as possible locations of activity centers when we define masks, so mask extents vary even more than they would if they were calculated as a simple buffer around traps.

We are interested in estimating average density within Zones, with an appropriate measure of uncertainty, to inform management at this spatial scale. We can easily estimate trapline-specific densities using single-session models, calculate an average density across traplines, and get confidence limits via the delta method. However, we are interested in estimating mean densities directly from the data using multisession models (with CL=T or D~1), with a measure of uncertainty that reflects variation in density among traplines (beyond what would be expected under Poisson or binomial assumptions).

I've been looking at the documentation for empirical.var.D, and it looks like derivedSession() will give us the average density empirical spatial variance we are looking for, without requiring that trap arrays have the same geometry across sessions?

I was wondering if I'm on the right track, and if there's a minimum number of sessions that would be recommended for this approach to be useful, but any advice is welcome!

Eric

Murray Efford

unread,
Dec 10, 2018, 4:00:15 PM12/10/18
to Eric Howe, secr
Sounds right in principle... I would use fixed-N ( details distribution="binomial") within each session. Let us know if there is a problem with the code.

--
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.

Eric H

unread,
Dec 14, 2018, 3:11:56 PM12/14/18
to secr
Thanks Murray,
I think see how using fixed-N makes sense (spatially unconditional variance within replicates).

derivedSession() requires a common detection model across sessions (my spatial replicates), however, when I fit models to our multisession data, session effects are sometimes supported; so if I force detection parameters to the same across traplines so that I can use derivedSession, I'd be estimating density from a model that does not fit the data well.

In the distance sampling context, counts of animals (n) on spatial replicates (transects) are weighted by transect length (if it varies).  I was wondering if counts on replicate trap arrays (secr "clusters") could similarly be weighted according to the area sampled. 

For example, they might be scaled by mask area, though this might not work well because buffers and masks are larger than necessary (?).  Nevertheless, given fixed or similar trap spacing across replicates, the mask area provides a relative measure of the area sampled, where differences in mask area among replicates are attributable to differences in geometry, or possibly differences in the amount of non-habitat in the vicinity of traps.

We can also estimate a-hat for each spatial replicate, including from models with session effects, using derived().  These estimates of a-hat capture the differences in the effective sampling area attributable to differences in estimates of detection parameters. However, a-hat ignores differences in the area sampled attributable to differences in cluster geometry (?)

I'm wondering if we could come up with a good way to weight cluster-specific counts by some cluster-specific measure of the area sampled, and also use cluster-specific a-hat to calculate the second component of the variance of Dhat. Perhaps by first calculating mean a-hat across replicates, and var(a-hat) via the delta method?

Any comments welcome.

Eric
 



 

Murray Efford

unread,
Dec 14, 2018, 5:34:37 PM12/14/18
to secr
Hi Eric
I'm a novice on this encounter-rate variance stuff. I agree we should look to distance sampling for analogies, at least that's what I do.

Not sure why you say a-hat ignores differences in cluster geometry - it should reflect geometry if done right. Mask area is an irrelevance in my view - how long is a piece of string?

The 'cluster' concept in secr assumes identity, whereas sessions can be as different as you like, so any development would probably be there. Deep thought needed here - maybe later in weekend! I doubt mean & variance of a(-hat) are going to help.

Murray

Murray Efford

unread,
Dec 15, 2018, 6:24:51 AM12/15/18
to Eric H, secr
This happens to relate to a problem I was working on last month from the viewpoint of study design - how to come up with an unbiased design-based estimate from random or systematic detector clusters across a region when some clusters are truncated by boundary or overlap with non-habitat. With line transects you know the length of transect surveyed so you can make a size-specific adjustment/weighting. With SECR in 2-D there is no well-defined plot 'size'. Using a-hat seems ad hoc but maybe ad hoc is good enough. I have rigged some code and it seems to 'work' in the sense of giving plausible answers, but needs testing. See also attached. Essentially this implements your suggestion. I don't think there's any problem with the second variance component - we're estimating overall D = n/A where A is sum of cluster specific a_i and can sum their variances (assuming independence). Any comments?

replicateclusters.pdf

Murray Efford

unread,
Dec 15, 2018, 4:33:42 PM12/15/18
to Eric H, secr
"... and can sum their variances (assuming independence)"
Probably not - they are far from independent when using detection parameters shared  across sessions (clusters). Back to the drawing board on that part.

Murray Efford

unread,
Dec 17, 2018, 5:30:48 AM12/17/18
to Eric H, secr
Progress. There's an obvious way to weight the var(a_j) as in the attached update of my earlier pdf. It seems to work, but it is not tested or certified. I have tentatively included the changes in my working version of secr (3.1.9) and can provide a copy soon if you want to try it (I'm waiting on the R Winbuilder service at present, and it seems to be stuck). I found a way to allow for varying geometry & habitat context in derivedCluster (simpler than derivedSession), and that seems to work well for simple models (but not yet for mixture models and probably some others).
replicateclusters.pdf
Message has been deleted

Eric H

unread,
Dec 17, 2018, 4:48:58 PM12/17/18
to secr

Thanks so much for following up with this Murray!
This all makes sense to me, though I'll need to read it a few more times! I'll certainly try it. 
It's not yet perfectly clear to me that the estimator applies to situations where some information is shared across sessions, but detection parameters still differ among sessions (e.g. additive session effects, or common g0 but different sigma).

Eric

Murray Efford

unread,
Dec 17, 2018, 5:29:09 PM12/17/18
to Eric H, secr
Yeah. Thanks. There are loose ends, and you've put your finger on one: I don't know if modelled differences in detection among replicates are a problem or not. You can have something intermediate between complete independence and complete dependence. My hunch is that any resulting bias in var(A-hat) will be tiny; even the weighting I suggest had little effect in the example I checked, because CV(a) was pretty near constant.

The code will be more stable if you can wait a day or so. It will be good to build some experience on which to build advice to users. I'll be in touch.
Murray

--

Murray Efford

unread,
Dec 19, 2018, 3:33:49 PM12/19/18
to secr
I've been running some trials with various variance estimators, weighted and unweighted. The major results are as expected
- if you have large-scale variation in density across your study area then assuming Poisson n causes the sampling variance (se(D-hat) to be underestimated
- 'empirical' estimates of var(n) by any of the methods (Poisson, weighted or unweighted) are OK (slightly +ve bias of se(D-hat) ) as long as the population is uniformly distributed and clusters are located as a simple random sample
- placing clusters systematically (with random origin) was more efficient than a random sample when density was NOT uniform, but none of the present 'empirical' estimators captured this benefit (i.e. se(D-hat) was overestimated). Weighted was somewhat better than unweighted in this case when cluster size correlates with density - in my example density was high at the coast so high densities were mostly sampled with truncated clusters). The Poisson estimator was very close to true se(D-hat), probably fortuitously.

Systematic designs are definitely recommended, but more work is needed on the variance cf Fewster 2011 Biometrics.

secr 3.2.0 will have the cluster-size-weighted 'empirical' variance options (R2 and R3 of Fewster et al. 2009). But as CRAN incoming is closing for a couple of weeks there will be some delay.

Eric H

unread,
Jun 24, 2019, 3:57:47 PM6/24/19
to secr
Thanks very much for your work on this Murray,

I am trying some of the new variance estimators with real data.  So far, nothing surprising to report.  I am able to calculate variances across clusters (traplines) that vary in spatial configuration, and which exhibit slightly different patters of variation in g0 and sigma, and yield slightly different values of these parameters.  This is what I was hoping for.  I'm still not 100% sure this is the approach we'll take, but it's great to be able to easily calculate variances different ways.

All the best,
Eric

Eric H

unread,
Jul 15, 2019, 12:15:37 PM7/15/19
to secr
Good day,

I notice that the default setting for the independent.esa argument of derivednj() and derivedSession() is FALSE.  If we have multiple spatially distinct trap arrays, modelled as "sessions", where the same animals are not detected at different arrays/sessions, then we have "non-overlapping" data, and we should set independent.esa = TRUE and use a simple rather than a weighted summation of esa variances, right?

Would it make sense to set the default for derivedSession to TRUE (sessions usually assumed to be and treated as independent samples, with no recaptures across sessions)?

Thanks again, some comparative results to follow soon.

Eric



On Wednesday, 19 December 2018 15:33:49 UTC-5, Murray Efford wrote:

Eric H

unread,
Jul 15, 2019, 1:57:09 PM7/15/19
to secr

Good day,

I've got some comparative estimates of density with confidence limits from sets of study areas ("traplines") within larger areas of interest (WLZs).
Recall that the spatial configuration of traplines varies, and that we were also concerned about variation in detection parameters among traplines.
Samples from all traplines should be adequate (30 - 60 animals, 3-4 detections per animal on average, plenty of spatial recaptures).
Estimates of sigma are consistent with independent information about sex-specific home range sizes, but variable.

MSdata WLZ8.jpeg




MSdata WLZ18.jpeg



I'd previously completed analyses of trapline-specific data to estimate density in the vicinity of each trapline.
Point estimates of density from different traplines in one WLZ (top figure, 5 traplines) were fairly similar (range 0.00038 - 0.00083 / ha).
Those in the other WLZ were more variable (range 0.00034 - 0.0018 / ha, where the highest estimate was more than double any of the other estimates).

I've since combined traplines within WLZs into multisession capthist objects (traplines as sessions) and conducted analyses to see if detection parameters varied among traplines. They seem to:

g0.bk.sex.sess.sig.sex.sess g0~bk + sex + session sigma~sex + session halfnormal   13 -2565.352 5156.705 5158.382   0.000      1
g0.bk.sex.sess.sig.sex                g0~bk + sex + session sigma~sex halfnormal    9 -2589.050 5196.100 5196.915  38.533      0
g0.bk.sess.sig.sex                          g0~bk + session sigma~sex halfnormal    8 -2594.476 5204.952 5205.600  47.218      0
g0.bk.sex.sig.sex.sess                g0~bk + sex sigma~sex + session halfnormal    9 -2829.447 5676.894 5677.708 519.326      0
g0.bk.sess.sig.sex.sess           g0~bk + session sigma~sex + session halfnormal   12 -2844.516 5713.032 5714.463 556.081      0
g0.bk.sex.sig.sex                               g0~bk + sex sigma~sex halfnormal    5 -2859.056 5728.113 5728.379 569.997      0
g0.bk.sig.sex.sess                          g0~bk sigma~sex + session halfnormal    8 -2886.982 5789.964 5790.612 632.230      0
g0.bk.sig.sex                                         g0~bk sigma~sex halfnormal    4 -2912.401 5832.803 5832.980 674.598      0


                                                                model   detectfn npar    logLik      AIC     AICc   dAICc AICcwt
g0.bk.sex.sess.sig.sex.sess g0~bk + sex + session sigma~sex + session halfnormal   15 -2933.997 5897.995 5899.827   0.000      1
g0.bk.sex.sess.sig.sex                g0~bk + sex + session sigma~sex halfnormal   10 -2946.782 5913.564 5914.388  14.561      0
g0.bk.sess.sig.sex.sess           g0~bk + session sigma~sex + session halfnormal   14 -2944.819 5917.638 5919.235  19.408      0
g0.bk.sex.sig.sex.sess                g0~bk + sex sigma~sex + session halfnormal   10 -2952.056 5924.113 5924.937  25.110      0
g0.bk.sess.sig.sex                          g0~bk + session sigma~sex halfnormal    9 -2957.572 5933.144 5933.815  33.988      0
g0.bk.sig.sex.sess                          g0~bk sigma~sex + session halfnormal    9 -2965.000 5947.999 5948.671  48.844      0
g0.bk.sex.sig.sex                               g0~bk + sex sigma~sex halfnormal    5 -2995.395 6000.790 6001.011 101.184      0
g0.bk.sig.sex                                         g0~bk sigma~sex halfnormal    4 -3007.725 6023.451 6023.597 123.770      0




Figures below show, for each WLZ,
Left (1): arithmetic mean of trapline-specific densities (Mean of LS) with no associated variance.
2): Mean density and associated confidence limits calculated using derivednj(..., method = "R2", independent.esa = TRUE) from trapline-specific model fits (esa and se.esa from AICc-minimizing model fit to trapline-specific data; R2; LS).
3): Mean D and CL calculated as above, but from the top AICc-ranked model fit to multisession data (includes differences in g0 and sigma among traplines; R2; top MS). Note that for the first (top) WLZ, fitting this model yielded NaN for some variances of g0 or sigma, such that se.esa was not estimable for all traplines, and we could not estimate variances usuing R2.
4): Mean D and CL calculated as above, but from a multisession model that assumes constant g0 and sigma across sessions (despite support for differences; R2; common detectpar).

Test comps WLZ8.jpeg



Test comps WLZ18.jpeg




Conclusions specific to these data:
  1. Ignoring differences in g0 and sigma across traplines within WLZs is not supported, and could bias D-hat, and causes underestimation of the variance of D-hat.
  2. Acknowledging that detection parameters do vary means precision doesn't improve much when we combine data from multiple traplines (relative to the precision of trapline-specific estimates).
  3. Estimating mean D and associated empirical variance (using R2) directly from trapline-specific results seems reasonable, and avoids the need to fit multisession models.Comments: 

Both D-hat and esa are sensitive to sigma, and therefore to samples of distances moved among traps.  Therefore, when we allow sigma to vary among traplines, D is relatively low and esa is relatively high (independent of array size or configuration) where sigma is relatively high. This means that traplines with high sigma and low D (for similar nj) will generally have higher weight. We can see that estimates of density across traplines are lower than the simple mean of trapline-specific estimates, especially where one of the traplines yielded a much higher density estimate than the others. This seems appropriate (larger area sampled, greater weight), but I might have some concerns about the influence of sigma (is it having too large an effect on the estimates). ????

Murray questioned: Is there a better weighting for the aj in Var(A)?  I wonder - would make a difference if we we avoided squaring linear distances to get areas when weighting? Would that make the weight more similar across traplines of similar configuration?  I.e., reduce the effect of sigma relative to array size in the weights?

Thanks again,
Eric

Murray Efford

unread,
Jul 23, 2019, 4:18:07 AM7/23/19
to secr
Eric - sorry I'm short of time to respond on this just now, but your results look interesting.
Murray

Eric H

unread,
Oct 10, 2019, 11:39:27 AM10/10/19
to secr
Good day,

I'm still working up comparisons of varD from replicate sampling units under different assumptions (detection parameters assumed to be constant or variable across replicates, Poisson vs empirical variances).

Two questions about these variance estimators, and their application in 'secr':

(1)  I'm looking at Buckland et al. (2001), Fewster et al. (2009), and, Murray's "replicateclusters.pdf" from 17-12-2018 in this thread.

In "replicateclusters" the first equation for the encounter rate variance for unequal line lengths in DS surveys matches Buckland et al.'s (2001) Equation 3.78 (page 79) for var(n), and the first equation for var(n) from an SECR survey with replicate sampling units is an exact match (substituting a's and A's for l's and L's, respectively).

However, varR2(n) from an SECR survey in replicateclusters.pdf is not an exact match for Fewster et al's (2009) varR2(n/L) from DS surveys (their Equation 3).  In Fewster et al, (k-1) is multiplied by L-squared (total line length squared) in the denominator of the first term, but there is no corresponding multiplication by A-squared (total effective sampling area squared).  Hoping someone can confirm for me that this is the adjustment to estimate var(n) rather than var(n/A) as described in "replicateclusters.pdf"? Thanks very much.

(2) My second question has to do with when replicates should be considered independent, and the 'independent.esa' argument of the derivednj function.  
Our replicates each have ~40 traps, and yielded sufficient data to estimate density in isolation; animals are not detected at > 1 replicate.  I can fit models to "replicate-specific" data, harvest n, a-sub-j, and the SE of a-sub-j from each (using derived), and calculate D and associated measures of uncertainty using derivednj. In this situation, sets of animals are independent, and no information is shared across replicates when estimating detection parameters, so I set indepdendent.esa = T.

I'm also fitting models to multisession data with replicates as sessions (to facilitate comparisons). In this situation, sets of animals do not overlap, but information is shared when estimating the parameters of the detection function, even if I include (additive) session effects. In this situation, since data is shared, should I set independent.esa = F? Thanks again.

Eric



Murray Efford

unread,
Oct 18, 2019, 4:47:47 PM10/18/19
to secr
Hi Eric
Sorry for the unavoidable delay - I hope to get back to you this coming week.
Murray

Eric H

unread,
Oct 20, 2019, 9:33:41 AM10/20/19
to secr
Good day Murray,
No problem at all, and I think we're making progress. Reasonably confident in the answers to my most recent questions, and have some comparative results to show you.
Eric

Manvi Sharma

unread,
Apr 6, 2020, 5:24:59 AM4/6/20
to secr
Dear Eric and Murray,

I was looking for answers to similar questions that I had for my study. I followed the thread and wanted to check if I am using the correct approach.
We had camera traps at 10 sites for sampling snow leopard population for a large region (Indian state). We used multisession models (D~session) to compare differences in estimates of D between sites. Now, we are interested in estimating mean densities at the larger spatial scale, using our multisession model (D~session).

I am using derived() to get estimate of D, se, and esa. for each site. From this thread - I am using weighted 'R3' method because they seem to work better (i.e related to overestimation of se) when D varies across the study area. I have 2 clarifications.

1. Can I say independent.esa = F, because the data is shared between sessions? This is similar to what Eric asked "sets of animals do not overlap, but information is shared when estimating the parameters of the detection function, even if I include (additive) session effects".

2. From the output of the derived(), can I calculate an average density across sites from (D~session) model for the whole state, and get confidence limits via the delta method?

3. Generally speaking, when there is heterogeneity in densities over space, is it better to use meaningful spatial covariate models to estimate densities (by taking average of predicted density surfaces), because they can use a inhomogeneous Poisson model?

This conversation thread was very helpful. Thanks!

Best,
Manvi

Eric Howe

unread,
Dec 17, 2020, 9:52:24 AM12/17/20
to secr
Hi Manvi,

Probably much to late to be useful, sorry I missed this post.
Answer to question 1 is "yes", if any information is shared when estimating parameters
2. I believe this is possible, but may require you to refit models and set contrasts.
3. If meaningful spatial covariates are available, results are likely to be more useful, and more precise. We struggle to identify useful covariates except at large spatial scales, due to lack of spatial resolution in anthropogenic mortality data, and bears' feeding behaviour (seasonal "migration" to abundant food, making it hard to quantify habitat quality within home ranges.)

Eric

Reply all
Reply to author
Forward
0 new messages