[AniMov] Import a grid in adehabitat

Clément Calenge calenge at biomserv.univ-lyon1.fr
Wed May 17 09:11:15 CEST 2006


Dear Ferdinando,

>anyway, my main problem remains. I want to use the same grid (same resolution and same "zero") for many animals (about 20 roe deers), and for different localization data sets of the same animal, but the whole area occupied by them is about 28 km x 23 km (even if each animal stays in a much smaller area). using a resolution of 10 meters leads to a grid of about 2800 x 2300 pixels. if i try to use this grid, even for just one animal, it imply computation time in the order of geological ages (about 10 minutes for an home range usually performed in few seconds, even with a grid=250).
>
>i want to use a regular grid (so that i have always the same resolution and pefectly overlapping grids, making comparisons easier). i could try to cut my big grid for every animal, according to the Xmin, Xmax, Ymin, Ymax of my localizations, but still i have a problem if a want to calculate an home range for many animals at a time and they have different Xmin, Xmax, Ymin, Ymax.
>  
>

You can use the same grid for all animals by passing your map as the 
grid parameter. But a large amount of time is indeed needed in this case 
(the UD is estimated for all pixels of the map, even those that are 
located far from the home range). A possible alternative would be to 
change the kernel used. The Epanichnikov kernel (parameter kern="epa") 
is more faster: only the grid pixels close to the relocations so that 
the empty space between animals is not taken into account in the 
calculations. I take an example:

## creates a virtual dataset
x1 <- rnorm(1000, 1)
y1 <- rnorm(1000, 1)
x2 <- rnorm(1000, 20)
y2 <- rnorm(1000, 20)
xy1 <- data.frame(x=x1, y=y1)
xy2 <- data.frame(x=x2, y=y2)
xy <- rbind(xy1, xy2)
id <- factor(c(rep(1, 1000), rep(2,1000)))
plot(xy, pch=16, cex=0.5)

## Now, creates the grid
gr <- ascgen(xy, cellsize=0.1)
image(gr)

## Now, fit the kernel home range
kud <- kernelUD(xy, id, grid=gr, kern="epa")
image(kud)

Note that the Epanechnikov kernel is more than 50 time faster than the 
bivariate normal one (in this case, in your case it will be even faster):

 > system.time(kud <- kernelUD(xy, id, grid=gr, kern="epa"))
2.97 0.00 2.98 NA NA
 > system.time(kud <- kernelUD(xy, id, grid=gr))
174.57   0.01 193.17     NA     NA

But note that LSCV is not available for this kernel, and that the 
smoothing parameter cannot be compared with the bivariate normal kernel.
HTH,

Clem

-- 
Clément CALENGE
LBBE - UMR CNRS 5558 - Université 
Claude Bernard Lyon 1 - FRANCE
tel. (+33) 04.72.43.27.57
fax. (+33) 04.72.43.13.88 




More information about the AniMov mailing list