Gamma key function offset for MRDS analysis

84 views
Skip to first unread message

mitchel...@gmail.com

unread,
Feb 17, 2021, 8:28:31 PM2/17/21
to distance-sampling

Hi Everyone,

I’m trying to fit a gamma key function to some mark-recapture observer data. There is roughly a 20% reduction in observer efficiency near the track line, as is expected from the aerial survey platform.  Since the gamma key function assumes zero detections at distance zero, I need to offset the data to improve the fit of the detection function near the track line.  If I offset all the observation distances by a set amount and then Left Truncate the data by the same amount, it serves to trick the analysis into altering the detection probability on the track line but the resulting AIC values from differing offsets do not make sense.  Regardless of the fit of the gamma key function to the data, the AIC values are always lower at increasing offset distances.  Is there an alternate approach to forcing an offset when fitting the Gamma key function?

Thanks,

Mitch

Eric Rexstad

unread,
Feb 19, 2021, 4:41:17 AM2/19/21
to mitchel...@gmail.com, distance-sampling

Mitch

I don't have much experience with the gamma key function, so my observations are merely casual.  But two published papers that employ the gamma key in the detection function present their detection distances:

Becker and Quang (2009)

Walsh et al (2010)

I don't believe either paper employs an offset in their analysis.

--
You received this message because you are subscribed to the Google Groups "distance-sampling" group.
To unsubscribe from this group and stop receiving emails from it, send an email to distance-sampl...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/distance-sampling/2a42d9d8-d8a6-402d-bc41-e8400ca486cdn%40googlegroups.com.
-- 
Eric Rexstad
Centre for Ecological and Environmental Modelling
University of St Andrews
St Andrews is a charity registered in Scotland SC013532

mitchel...@gmail.com

unread,
Mar 4, 2021, 3:16:23 PM3/4/21
to distance-sampling

Thanks Eric,

To try and sort out the issue, I simulated a dataset with a gamma distribution using ‘rgamma’ function (n=10000).  As expected, the modelled gamma function fit the unmodified data with no issues (Figure 1). To simulate my field collected data, I removed all of the data between zero and 320 m, and shifted all the remaining distance values by 320 m so that observations now began at distance zero.  I then modelled the detection function at different offset distances and compared the AIC scores.  The lowest AIC score corresponded to an offset distance of 285 which is a reasonable approximation of the first 320 m originally trimmed from the dataset.  I did note that the resulting detection functions indicated that the modelled function now dropped below the peak of the data histogram when compared to the unmodified dataset (Figure below right, offset 320 m). 

Gamma Dist.png       GammaDist Left Trunc.png

When I obscure the dip in detections near the track line by lowing the sample size (n=1000) the decoupling of the modelled detection function from the data histogram becomes more obvious. Below at left is the modelled function for the 320 m offset that corresponds to the original data truncation (AIC=9929.629) and at right is the lowest AIC score (665 m offset, AIC = 9929.191).  I should mention that the differences between AIC scores, at further offset distances, does become very slight.  

GammaDist2 offset 320m.png  GammaDist2 offset 665m.png


This would all indicate to me that Left Truncation is not appropriate when using a gamma key function?  

I'm not aware of an alternative method but Doniol-Valcroze et. al 2013 presents a figure, included below, that indicates that g(0) has been offset (the article's text only refers to an offset term for the gamma key function). 

Thanks in advance for any comments.

Mitch

Doniol-Valcroze.PNG


Stephen Buckland

unread,
Mar 4, 2021, 4:17:20 PM3/4/21
to mitchel...@gmail.com, distance-sampling

Mitch, I think you are possibly left-truncating incorrectly.  It’s possible that you have fitted the gamma as if the truncated values are all zero, rather than truncated.  This would drag the fit down – and the more you left-truncate, the worse it will be.  In your simulated case, you know the origin is at zero, so the better strategy would be not to subtract the left-truncation value from each distance, and then use a fitting algorithm that allows left-truncation.  The Distance software allows this.  However, for your real data, as the function would not reach zero at zero distance, your approach of subtracting the left-truncation distance, and then allowing an offset, should be better.  But you still need to use fitting software that allows left-truncation (as well as right-truncation of course).  Otherwise, you get results like those you report here.

 

Steve Buckland

mitchel...@gmail.com

unread,
Mar 4, 2021, 8:03:48 PM3/4/21
to distance-sampling
Thanks Steve, 

I suspected that zeros were pulling down the curve but I believe I'm applying the offset as you suggest (if I'm interpreting your comments correctly). My work flow for applying an offset to the real data and simulated data was the same. I started with (i) base data that did not appear to have zero observations at zero distance, (ii) for each iteration of offset distance, I added the offset distance to all observations, and (iii) then performed the analysis using the same offset value for left truncation.  Correct?

Mitch

Base Data.png Base Data with Offset.png

Analysis with Left Truncation.png

Stephen Buckland

unread,
Mar 5, 2021, 3:05:00 AM3/5/21
to mitchel...@gmail.com, distance-sampling

The problem is with the left-truncation I think, not the offset.  If you retained the counts in the lower tail, the bias should be a lot less.  There will probably still be some bias due to lack of fit in the lower tail.  If you truncate the lower tail (which is likely to be the better option), then the fitting method needs to take that into account.  Technically, if maximum likelihood is used for fitting, you need to rescale the probability density function so that it integrates to 1 over the truncated range, then form the likelihood using this rescaled pdf.  (The same applies with right-truncation.)

 

Steve

mitchel...@gmail.com

unread,
Mar 22, 2021, 11:25:34 PM3/22/21
to distance-sampling
I understand the basics of what you're saying regarding "Technically, if maximum likelihood is used for fitting, you need to rescale the probability density function so that it integrates to 1 over the truncated range, then form the likelihood using this rescaled pdf." but I don't understand how to do this within the MRDS R package.  Can you point me in the right direction regarding how I might accomplish this?

Thanks,
Mitch

Eric Rexstad

unread,
Mar 23, 2021, 8:50:23 AM3/23/21
to distance...@googlegroups.com, mitchel...@gmail.com

Mitch

When using `ddf()` in the mrds package, check the `meta.data` function that takes a named list.  Elements of that named list can be created as follows:

meta.data=list(left=1,width=10)

to specify left and right truncation points.

mitchel...@gmail.com

unread,
Mar 23, 2021, 1:57:06 PM3/23/21
to distance-sampling
Ok, maybe I didn't understand what you meant in the previous comment.  Is there a way to remove the bias caused by the fitting of the gamma function between zero and the left offset value? (i.e. ignore the left truncation region when fitting the detection function - but keeping the requirement for zero detections at zero distance)

Thanks,
Mitch  


Reply all
Reply to author
Forward
0 new messages