Re: [unmarked] mapping spatial predictions using pcount

170 views
Skip to first unread message

Richard Chandler

unread,
May 9, 2013, 11:26:52 AM5/9/13
to Unmarked package
Hi Hannah,

As you suspected, you need to include the offset in the linear model.
However, I don't think it is ideal to use transect length as an offset
of abundance. Can you use the area sampled instead? If the transects
had fixed widths, and were narrow enough to make distance-related
heterogeneity in detection negligible, then you could use (log)
transect area as an offset to estimate density. Then you could scale
that up to the level of a raster pixel.

Richard


On Thu, May 9, 2013 at 11:14 AM, Hannah OKelly <hok...@wcs.org> wrote:
> Dear Forum Users,
>
> I am modelling the “abundance” of snares using pcount and I am trying to map
> the spatially referenced predictions. By following the vignette "Modeling
> and mapping species distributions" I was able to use the function predict
> with a large RasterStack object but it took a LONG time and the resultant
> maps did not make sense. To diagnose the problem more quickly I am
> attempting to replicate the predict function manually (without SEs or CIs)
> but I am not sure if my code below is correct as the resultant maps are also
> non-sensible.
>
>
> ###model
>
> testfm5<-pcount(~hab+climb+season
> ~distvil+I(distvil^2)+distbd+distst+offset(log(aveff)), data=Umf_snare,
> K=150)
>
> ##code for manually predicting
>
> ###note: ditsvil2, distst2 etc are Raster data standardised using mean & sd
> of original data
>
> > (betafm5 <- coef(testfm5, type="state"))
>
> lam(Int) lam(distvil) lam(I(distvil^2)) lam(distbd)
>
> -1.6945142 -0.3815708 0.3012705 -0.2381248
>
> lam(distst)
>
> -0.5810733
>
>
>
> lam5 <- betafm5[1] + betafm5[2]*distvil2 + betafm5[3]*distvil2^2 +
> betafm5[4]*distbd2 + betafm5[5]*distst2
>
> pred <- exp(lam5)
>
> print(spplot(pred, col.regions=terrain.colors(100)))
>
>
>
> Also; I have included length of transect walked per site as an offset in my
> model (which I think make it abundance per km walked). In the vignette
> example “area” of site is included as an offset (which makes it density) and
> an additional raster layer for area is incorporated into the mapping
> process. I am wondering how (or if) I deal with my offset for effort in my
> mapping attempts (sites are 1km squared, transect effort per site is 1.5 to
> 4km, and my pixel size in raster data is 100x100).
>
> Any advice greatly appreciated.
>
> --
> You received this message because you are subscribed to the Google Groups
> "unmarked" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to unmarked+u...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Hannah OKelly

unread,
May 10, 2013, 6:22:40 AM5/10/13
to unma...@googlegroups.com

Many Thanks Richard,

I was, in part, following Kéry et al. 2005, who also had transects within quadrants and used route length as an abundance covariate to account for similar variation within effective sampled area. My transects were not fixed width and there is considerable variation in terms of visibility amongst habitats sampled.  In actuality snares are so well concealed they are only usually detected on or within a couple meters of a transect irrespective of habitat, so the effective sampled area was just a narrow strip, which I could guestimate, but still I am not sure I could comfortably assume negligible heterogeneity in detection across habitats.  Hmmmm.

How about the rest of my equation attempting to replicate manually what Predict does with pcount, does that look correct at least?

Hannah

Richard Chandler

unread,
May 10, 2013, 8:25:41 AM5/10/13
to Unmarked package
Hi Hannah,

Maybe Marc and Andy can weigh in on what they think is the best
option. I know that in the past they have used transect length in some
way as an offset of the number of individuals exposed to sampling.
That might be a good option, but I don't think they simply used
offset(log(length)). One paper that proposes a nice modeling framework
for this type of data is Royle et al (2011, MEE):

http://onlinelibrary.wiley.com/doi/10.1111/j.2041-210X.2011.00116.x/full

but the model requires that the individuals (snares in your case) are
marked. Perhaps it's something to consider if you continue sampling.

Richard

Richard Chandler

unread,
May 10, 2013, 9:03:58 AM5/10/13
to Unmarked package
... and yes, this code is correct:

lam5 <- betafm5[1] + betafm5[2]*distvil2 + betafm5[3]*distvil2^2 +
betafm5[4]*distbd2 + betafm5[5]*distst2
pred <- exp(lam5)

except that you need to add in the offset.

Hannah OKelly

unread,
May 10, 2013, 10:09:05 AM5/10/13
to unma...@googlegroups.com

Yes, you’re right, it was actually the inverse of transect length that Marc and Andy used to deal with the “exposed population” issue, but I didn’t think this was appropriate in my context because we never came anywhere close to saturation in terms of sampling each site. In any case, now I have a quicker plotting method I’ll try a few approaches and see how the maps look; I’m not interested in absolute numbers of snares but more a relative picture with which to compare anti-poaching patrol data.

The paper you refer to could certainly be a very useful sampling framework, and not just for snares (I also use scat dogs which generate exactly this type of data). In fact, snares are uniquely identifiable by gps-marked location, but because different routes were walked there were no “re-captures”, and this is something I will definitely change if we repeat the survey (i.e. observes will follow the same routes).  I guess I’ll also have to bite the bullet with WinBUGS....

Thanks again for all your help and for keeping such a close eye on the forum!

Hannah

Kery Marc

unread,
May 10, 2013, 4:48:43 PM5/10/13
to unma...@googlegroups.com
hi Richard and Hannah,

I'm not sure why simply using log(length) as an offset on abundance should not be sensible ? This should give you an estimate of snare abundance per unit-length transect. But yes, we have used length in a slightly more complicated way as a proxy for the proportion of the nominal sample area covered (in Royle et al, Ecol. Mono., 2007), because our transects sampled a 1km2 quadrat in a highly sinuous way with frequent loops.

Kind regards -- Marc

________________________________________
From: unma...@googlegroups.com [unma...@googlegroups.com] on behalf of Richard Chandler [richard....@gmail.com]
Sent: 10 May 2013 14:25
To: Unmarked package
Subject: Re: [unmarked] mapping spatial predictions using pcount

Kery Marc

unread,
May 10, 2013, 4:53:22 PM5/10/13
to unma...@googlegroups.com
Hi Hannah,

btw, I find this a very neat application of an Nmix model ! And WinBUGS (and be sure to try JAGS as well) is not a bullet to bite, but rather a sweet cherry to enjoy ;)

Regards  ---  Marc



From: unma...@googlegroups.com [unma...@googlegroups.com] on behalf of Hannah OKelly [hok...@wcs.org]
Sent: 10 May 2013 16:09
To: unma...@googlegroups.com

Subject: Re: [unmarked] mapping spatial predictions using pcount

Hannah OKelly

unread,
May 13, 2013, 10:33:51 AM5/13/13
to unma...@googlegroups.com

Hi Marc,

Yes, a measure of abundance per km walked was what I thought I was getting, possibly more appropriate as we just did one pass through each site and so effectively sampled only a minimal proportion of it. My difficulty comes when trying to translate this into a map, because I am not sure how to reconcile the scale of my estimates with that of my covariate data used for prediction.

Hannah

Richard Chandler

unread,
May 13, 2013, 10:49:10 AM5/13/13
to Unmarked package
This is why it is better, in my opinion, to model density rather
abundance in some unknown area. Since you don't have either fixed area
plots or distance data, you can't really get at density, but you
should be able to map the expected number of snares exposed to
sampling, given some transect length and the pixel-level covariates.
But note that this is different than the expected number of snares in
some pixel of your raster.

Richard

Hannah OKelly

unread,
May 15, 2013, 10:08:43 AM5/15/13
to unma...@googlegroups.com

Thanks Richard, I see the distinction you point out here, and it is important, so my approach is not entirely satisfactory, but maybe still useful in relative terms.  Especially as I’ll be comparing these results with patrol data consisting of a similar measure – encounters per unit effort. I may also experiment with transect width and translating into density, just to see how it looks.

Thanks again,

Hannah

Reply all
Reply to author
Forward
0 new messages