Plotting detection functions in distance sampling

307 views
Skip to first unread message

Andrew Cox

unread,
Apr 20, 2012, 11:57:10 AM4/20/12
to unmarked
Hi,
I am trying to plot a detection function mostly using code provided
in the distance sampling vignette but I am clearly doing something
wrong, probably because this is my first foray into distance sampling
as well as R. First I used this code to estimate detectability for
100m radius point counts with a hazard key function:

shape<-exp(coef(StockObs,type="det"))
scale<-exp(coef(StockObs,type="scale"))
ea<-2*pi*integrate(grhaz,0,100,shape=shape[1],scale=scale)$value
sqrt(ea / pi)
ea/(pi*100^2)

which so far as I can tell will use the shape and scale from a model
called "StockObs" to estimate detectability. This appears to work
okay, as detectability values for species are near what we would
expect (0.2-0.5).

But when I go to plot the detection function using this code:

plot(function(x) grhaz(x, shape=shape[1], scale=scale), 0, 100,
xlab="Distance (m)", ylab="Detection prob.")

I get a plot that has detection probabilities >1 (up to 20!).

Any help is much appreciated!

Andrew

Richard Chandler

unread,
Apr 20, 2012, 12:17:28 PM4/20/12
to unma...@googlegroups.com
Hi Andrew,

For point transects, your formula looks correct: ea/(pi*radius^2). You can also let unmarked do this for you with: rowSums(getP(fm)). For plotting Pr(detection | distance), you should use gxhaz not grhaz, even though you have point count data. Try this

   plot(function(x) gxhaz(x, shape=shape[1], scale=scale), 0, 100,

        xlab="Distance (m)", ylab="Detection prob.")


Richard

btw, I think Andy once pointed out to me that unmarked uses "scale" and "shape" incorrectly. They should be switched I guess...

_____________________________________
Richard Chandler, post-doc
USGS Patuxent Wildlife Research Center
301-497-5696



From: Andrew Cox <ktal...@yahoo.com>
To: unmarked <unma...@googlegroups.com>
Date: 04/20/2012 11:59 AM
Subject: [unmarked] Plotting detection functions in distance sampling
Sent by: unma...@googlegroups.com


Andrew Cox

unread,
Apr 20, 2012, 2:37:16 PM4/20/12
to unma...@googlegroups.com
Thanks Richard!  That did the trick.  
Reply all
Reply to author
Forward
0 new messages