Skip to content

adehabitatHR use different bandwidth for kernelUD

2 messages · proleet at web.de, Maren Huck

#
Dear Hagen,

It is possible. I copy some code that I have used myself, so you would have to adapt it.

First, you have to make sure that the kernel is calculated based on the same underlying grid. If you use slightly different h-values, these are normally slightly different.

minX<-min(my_data$X_POS)     # calculate minimum and maximum values of the locations
maxX<-max(my_data$X_POS)
minY<-min(my_data$Y_POS)
maxY<-max(my_data$Y_POS)
a <- seq(minX-0.002*minX,maxX+0.002*minX,by=11.4)    # where resolution is the pixel size you desire, you might have to play around with these values. Perhaps have a look at the typical values first

b <- seq(minY-0.0001*minY,maxY+0.0001*minY,by=11.4)
ab <- expand.grid(x=a,y=b)
coordinates(ab) <- ~x+y
gridded(ab) <- TRUE
class(ab)

udhref_all<- kernelUD(my_data[,1], h="href", grid=ab)


KernelFloater<- kernelUD(Floatersp, h=86, grid=ab)
KernelB68<- kernelUD(B68sp, h=26, grid=ab)

listuds<-list(Solitary = KernelFloater, B68 = KernelB68)  # the list can be as long as you want. The name before the = is just the name you will see in your output
class(listuds)<-"estUDm"
kerneloverlaphr(listuds, method = "HR", percent =95, grid=ab)*100   # to get the overlap in percent overlap
kerneloverlaphr(listuds, method = "UDOI", percent =95, grid=ab)   # to get the Utilization distribution overlap index

The bit about the grid I found somewhere online when googling. Maybe try to google for
"ab <- expand.grid(x=a,y=b)"
because I think that is one of the original codelines there. You might get further explanations theree.


Hope that helps,

Maren

(P.S. If you have further questions, you can also e-mail me directly and in German)


Maren Huck
Dep. of Natural Sciences
University of Derby
Kedleston Road
Derby DE22 1GB
U.K.
Tel: +44-1332-592354
m.huck at derby.ac.uk