problem with kernel UD estimation using adehabitatHR

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

problem with kernel UD estimation using adehabitatHR

lnmessinger
This post was updated on .
I have data containing locations of 100+ pheasants during 3 seasons. I am looking to estimate kernel home ranges for each of the seasons for each individual. I run the kernelUD() function with no errors or warnings, but am receiving an error message when I attempt to use the getverticeshr() and kernel.area() functions to extract 95% polygons and area estimates from the kernel UD's.

Here is the structure of the input data set:

Formal class 'SpatialPointsDataFrame' [package "sp"] with 5 slots
  ..@ data       :'data.frame': 2376 obs. of  1 variable:
  .. ..$ ID: Factor w/ 122 levels "150.002_2013_KOR",..: 1 1 1 1 1 1 2 2 2 2 ...
  ..@ coords.nrs : num(0)
  ..@ coords     : num [1:2376, 1:2] 347887 347862 347948 347964 348200 ...
  .. ..- attr(*, "dimnames")=List of 2
  .. .. ..$ : NULL
  .. .. ..$ : chr [1:2] "X_Estimate" "Y_Estimate"
  ..@ bbox       : num [1:2, 1:2] 315869 4442294 349590 4472129
  .. ..- attr(*, "dimnames")=List of 2
  .. .. ..$ : chr [1:2] "X_Estimate" "Y_Estimate"
  .. .. ..$ : chr [1:2] "min" "max"
  ..@ proj4string:Formal class 'CRS' [package "sp"] with 1 slots
  .. .. ..@ projargs: chr NA

The following code works without errors or warnings for my "pre" season data:

kud.pre<-kernelUD(pre.hr.id[,1],h="href",extent=1)
pre.hr.poly<-getverticeshr(kud.pre, percent=95)
pre.kud.area<-kernel.area(kud.pre,percent=95)

However, when I repeat my other 2 seasons, kernelUD() runs with no errors or warnings:

kud.early<-kernelUD(early.hr.id[,1],h="href",extent=1)

but I get the following error when running the getverticeshr() function:

early.hr.poly<-getverticeshr(kud.early, percent=95)

Error in getverticeshr.estUD(x[[i]], percent, ida = names(x)[i], unin,  :
  The grid is too small to allow the estimation of home-range.
You should rerun kernelUD with a larger extent parameter

I have adjusted the extent parameter as requested, using values of 0.5,1,5,10,25,100 and all produce the same error. I am able to generate mcp's using the same data without a problem and like I said, kernelUD() works with no errors or warnings for all 3 seasons and I am able to see each UD when I look at the image.

I should mention that when I use same4all=TRUE in kernel UD() and I look at the image, several of the UD's display as a solid orange block and when I adjust the extent, more or less of the individuals display as orange depending on the extent value.

What I find particularly strange is that I am able to run kernel.area() and even with warnings that say:

1: In kernel.area(j, percent, unin, unout) :
  The grid is too small to allow the estimation of home-range
for the following value of percent: 95. You should rerun kernelUD with a larger extent parameter

I still get a data frame with area values for each individual. It seems as if an area is estimated regardless of the error warning of small extent size.

Has anyone experienced a similar issue or have a suggestion as to how I should proceed?

Thanks,
Lindsey


Reply | Threaded
Open this post in threaded view
|

Re : problem with kernel UD estimation using adehabitatHR

Mathieu Basille-3
Hey Lindsey,

Just a blind guess here, did you try using a SpatialPixels instead of the default number for the 'grid' parameter in 'kernelUD'? It might solve your problem, in addition to give you more flexibility on the format of the output.

Mathieu.


---- Le mar., 03 juin 2014 17:03:46 -0400 lnmessinger<[hidden email]> a écrit ----

 > I have data containing locations of 100+ pheasants during 3 seasons. I am
 > looking to estimate kernel home ranges for each of the seasons for each
 > individual. I run the kernelUD() function with no errors or warnings, but am
 > receiving an error message when I attempt to use the getverticeshr() and
 > kernel.area() functions to extract 95% polygons and area estimates from the
 > kernel UD's.
 >  
 > Here is the structure of the input data set:
 >  
 > Formal class 'SpatialPointsDataFrame' [package "sp"] with 5 slots
 >   ..@ data       :'data.frame':    2376 obs. of  1 variable:
 >   .. ..$ ID: Factor w/ 122 levels "150.002_2013_KOR",..: 1 1 1 1 1 1 2 2 2 2
 > ...
 >   ..@ coords.nrs : num(0)  
 >   ..@ coords     : num [1:2376, 1:2] 347887 347862 347948 347964 348200 ...
 >   .. ..- attr(*, "dimnames")=List of 2
 >   .. .. ..$ : NULL
 >   .. .. ..$ : chr [1:2] "X_Estimate" "Y_Estimate"
 >   ..@ bbox       : num [1:2, 1:2] 315869 4442294 349590 4472129
 >   .. ..- attr(*, "dimnames")=List of 2
 >   .. .. ..$ : chr [1:2] "X_Estimate" "Y_Estimate"
 >   .. .. ..$ : chr [1:2] "min" "max"
 >   ..@ proj4string:Formal class 'CRS' [package "sp"] with 1 slots
 >   .. .. ..@ projargs: chr NA
 >  
 > The following code works without errors or warnings for my "pre" season
 > data:
 >  
 > kud.pre<-kernelUD(pre.hr.id[,1],h="href",extent=1)
 > pre.hr.poly<-getverticeshr(kud.pre, percent=95)
 > pre.kud.area<-kernel.area(kud.pre,percent=95)
 >  
 > However, when I repeat my other 2 seasons, kernelUD() runs with no errors or
 > warnings:
 >  
 > kud.early<-kernelUD(early.hr.id[,1],h="href",extent=1)
 >  
 > but I get the following error when running the getverticeshr() function:
 >  
 > early.hr.poly<-getverticeshr(kud.early, percent=95)
 >  
 > Error in getverticeshr.estUD(x[[i]], percent, ida = names(x)[i], unin,  :  
 >   The grid is too small to allow the estimation of home-range.
 > You should rerun kernelUD with a larger extent parameter
 >  
 > I have adjusted the extent parameter as requested, using values of
 > 0.5,1,5,10,25,100 and all produce the same error. I am able to generate
 > mcp's using the same data without a problem and like I said, kernelUD()
 > works with no errors or warnings for all 3 seasons and I am able to see each
 > UD when I look at the image.
 >  
 > What I find particularly strange is that I am able to run kernel.area() and
 > even with warnings that say:
 >  
 > 1: In kernel.area(j, percent, unin, unout) :
 >   The grid is too small to allow the estimation of home-range
 > for the following value of percent: 95. You should rerun kernelUD with a
 > larger extent parameter
 >  
 > I still get a data frame with area values for each individual. It seems as
 > if an area is estimated regardless of the error warning of small extent
 > size.
 >  
 > Has anyone experienced a similar issue or have a suggestion as to how I
 > should proceed?
 >  
 > Thanks,
 > Lindsey
 >  
 >  
 >  
 >  
 >  
 >  
 > --
 > View this message in context: http://r-sig-ecology.471788.n2.nabble.com/problem-with-kernel-UD-estimation-using-adehabitatHR-tp7578930.html 
 > Sent from the r-sig-ecology mailing list archive at Nabble.com.
 >  
 > _______________________________________________
 > R-sig-ecology mailing list
 > [hidden email]
 > https://stat.ethz.ch/mailman/listinfo/r-sig-ecology 
 >


--

~$ whoami
Mathieu Basille, PhD
 
~$ locate --details
University of Florida \\
Fort Lauderdale Research and Education Center
(+1) 954-577-6314
http://ase-research.org/basille 
 
~$ fortune
« Le tout est de tout dire, et je manque de mots
Et je manque de temps, et je manque d'audace. »
  -- Paul Éluard

_______________________________________________
R-sig-ecology mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
Reply | Threaded
Open this post in threaded view
|

Re: problem with kernel UD estimation using adehabitatHR

alittle
In reply to this post by lnmessinger
Lindsey,

Were you able to resolve the issue with the extent? I too am having the same problem with a data set that I'm working on. I tried different extend (similar to you) but received the same error message:

>kud50 <- getverticeshr(kudbreeding, 50)

Error in getvertices.estUD(x[[i]],percent,ida=names(x)[i],unin,  :

The grid is too small to allow the estimation of home range. You should rerun KernelUD with a larger extent parameter.

R-code below that resulted in the error:

kudbreeding <- kernelUD(locbreeding[,1],h='href',kern='bivnorm',same4all=TRUE,extent=25)

kud50 <- getverticeshr(kudbreeding,50)

I would greatly appreciate any input from those who have used KernelUD in adehabitat.

Thanks,
   Andy
Reply | Threaded
Open this post in threaded view
|

Re: problem with kernel UD estimation using adehabitatHR

dmaa
Any news on this? I'm having a similar problem.

In addition,
kernel.area(x,percent=c(50,95),unout="m2",standardize=F) provides different area values when compared with those obtained by using getverticeshr(kudvej, 95,unout="m2")
Reply | Threaded
Open this post in threaded view
|

Re: problem with kernel UD estimation using adehabitatHR

André Zehnder
Hi dmaa,

I got this error when I used too low grid values to quickly checked the
results. Try different values for the "grid" parameter (e.g. grid=450).

In addition, the extent values of alittle seem to be rather high. As I
understand it (and please correct me if I am wrong), the extent is a factor
that defines by how much percent of the range of coordinates included in a
dataset is extended, so that the UD is not cut off too early. For example:
If the bounding box around your coordinates is 300x300 km, a extent of 0.1
would expand this area by 10% (in total 330x330 km). Therefore, unless you
have enormously high smoothing parameters and/or tiny home ranges to expect,
extents of 0.1–0.5 will be enough.

About the area issue: Are the differences large or so small that they are
negligible and possibly only a result of different precisions? Another
reason could be that one of the two methods considers holes and subtract
their areas while the other does not.

Best regards,
André

-----Ursprüngliche Nachricht-----
Von: R-sig-ecology [mailto:[hidden email]] Im Auftrag
von dmaa
Gesendet: Montag, 13. Juli 2015 13:48
An: [hidden email]
Betreff: Re: [R-sig-eco] problem with kernel UD estimation using
adehabitatHR

Any news on this? I'm having a similar problem.

In addition,
kernel.area(x,percent=c(50,95),unout="m2",standardize=F) provides different
area values when compared with those obtained by using getverticeshr(kudvej,
95,unout="m2")



--
View this message in context:
http://r-sig-ecology.471788.n2.nabble.com/problem-with-kernel-UD-estimation-
using-adehabitatHR-tp7578930p7579498.html
Sent from the r-sig-ecology mailing list archive at Nabble.com.

_______________________________________________
R-sig-ecology mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology

_______________________________________________
R-sig-ecology mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
Reply | Threaded
Open this post in threaded view
|

Re: problem with kernel UD estimation using adehabitatHR

dmaa
Hi André,

Your suggestion on grid parameters helped. I played with grid and extent and found nice solutions. Thanks!

After reading the package pdf I have found that
"Note that the home-range sizes returned by this function are slightly different from the home-range size stored in the SpatialPolygonsDataFrame returned by the function getverticeshr . Indeed, while the former measures the area covered by the rasterized home range (area covered by the set of pixels of the grid included in the home range), the latter measures the area of the vector home range (with smoother contour). However, note that the difference between the two estimates decrease as the resolution of the grid becomes finer"

Cheers,

David
Reply | Threaded
Open this post in threaded view
|

Re: problem with kernel UD estimation using adehabitatHR

Elizardo Lisboa
This post has NOT been accepted by the mailing list yet.
In reply to this post by lnmessinger
Hi guys,
I also had the same problem. However, I just did a "extent=2", because my sample is very larger. The extent default is 1. Then, you have to change the extent too. The grid default is 60. If you change to 450 or 1000 the quality is better of the pixels. Then, my script got like that:
   
(ud <- kernelUD(idsp[,1], grid=1000, extent=2)) #idsp is SpatialPointsDataFrame
image(ud)
verud <- getverticeshr(ud, percent=95)
verud
plot(verud, col=1:6) #because I have six animals

my email: elizardolisboa@gmail.com
Thank you!
Elizardo Lisboa