predictDsurface and "home range center" or "activity center"

questions concerning anlysis/theory using program DENSITY and R package secr. Focus on spatially-explicit analysis.

predictDsurface and "home range center" or "activity center"

Postby bear16 » Fri Nov 02, 2012 9:59 am

In one of the presentations at the recent Wildlife Society meeting, a presenter had a density surface map based on activity centers which had been obtained using methods in Gardner et al (2010). I am interested in whether it is possible to do something similar using the secr package in R. Borchers and Efford (2008) describe "home range centers", which sound equivalent to the "activity center" from Gardner et al (2010), though Gardner et al use Bayesain methods instead of likelihood methods.

I found the help file "Modelling density surfaces in secr" and have been looking through it. The possom model includes a quadratic density surface and one based on distance to shore. Is it possible to create a density surface based on the "home range center"? Is there a way to obtain the x, y coordinates for the "home range centers"?
bear16
 
Posts: 20
Joined: Thu Oct 14, 2010 11:18 am

Re: predictDsurface and "home range center" or "activity cen

Postby murray.efford » Fri Nov 02, 2012 3:15 pm

Try fxi.contour() for plots of the probability density of individual home-range centres (=activity centres). I think it's misleading to call a plot like the one you've seen a 'density surface map'. It indicates what we know about the home-range centres of the particular individuals that were detected (a subset of the realised population), neither clearly the 'realised' nor 'expected' populations. Conceptually very messy. I have thought of making it easy to display fxi.contour summed over individuals with an added component for the expected number of undetected animals, but would then have to advise people not to use it!

Murray
murray.efford
 
Posts: 686
Joined: Mon Sep 29, 2008 7:11 pm
Location: Dunedin, New Zealand

Re: predictDsurface and "home range center" or "activity cen

Postby bear16 » Thu Nov 08, 2012 6:37 pm

Thank you very much for your help. The fxi functions definitely address what I was looking for.

I feel rather silly asking this because I imagine it is straightforward, but how do I print the list of the estimated locations of the "home range centers"? fxi.contour plots the coordinates with the corresponding contours and the manual indicates that it will return a list of coordinates, or more specifically the mode if I include fitmode=TRUE. However, I do not know how to get it to give me the list. I obtain a plot and then have tried summary(fxi.contour) or just fxi.contour, but neither work. In looking at the file for fxi.mode, I assume this should give me the x- and y-coordinates for one specific detection history, but for whatever reason, R crashes every time I try to use it.

Thank you for your patience as I learn about the secr package and R in general.
bear16
 
Posts: 20
Joined: Thu Oct 14, 2010 11:18 am

Re: predictDsurface and "home range center" or "activity cen

Postby murray.efford » Fri Nov 09, 2012 12:17 am

It looks like fxi.contour is inconsistent in the way it formats output (I'm tempted to blame that on a change in R, but I don't really know). For example, fxi.contour produces output in different forms for i = 3 and i = 76 with the model secrdemo.0 fitted to 'captdata'. Until I fix secr, this should work (copy and paste at R prompt):

Code: Select all
library(secr)
extractmode <- function(fxiout) {
    if (is.matrix(fxiout))
        do.call(rbind, fxiout['mode',])
    else
        t(sapply(fxiout, function(x) x$mode))
}
temp <- fxi.contour(secrdemo.0, 3)
extractmode(temp)
plot(traps(captdata), detpar = list(col = 'blue'))
temp <- fxi.contour(secrdemo.0, 76, fitmode = TRUE, plotmode= FALSE, plt = TRUE, add = TRUE)
extractmode(temp)


Now try plotting extracted modes over contours:
Code: Select all
points(extractmode(temp), pch = 16,col = 'red')


Note that fxi.mode is optionally used in fxi.contour to 'refine' an initial estimate from the average of points on the innermost contour; used on its own with naive starting values it often fails.

Hope that works for you
Murray
murray.efford
 
Posts: 686
Joined: Mon Sep 29, 2008 7:11 pm
Location: Dunedin, New Zealand


Return to analysis help

Who is online

Users browsing this forum: No registered users and 14 guests