2

I know, there was similar question asked a while ago ("'Calloc 'could not allocate memory" in 64-bit R), and I tried to ask over there, but I was deleted... although as I said in my question, I did try their solutions (updating plugins), but it didn't work for me. Sooo, let me try again :)

When I try to use kernelUD() function from adehabitatHR package, depending on h parameter value I get that error. It's working with h="href" parameter, but not with h="LSCV" (different smoothing parameter)

require(adehabitatHR)
BCLoc <- puechabonsp$relocs[, 1] #data comes with adehabitatHR
BC.href <- kernelUD(BCLoc, h="href") #works :)
BC.LSCV <- kernelUD(BCLoc, h="LSCV") #gets error :(
Error in .kernelUDs(SpatialPoints(x, proj4string = CRS(as.character(pfs1))),  : 
  'Calloc' could not allocate memory (18446744071710095360 of 8 bytes)

any ideas?

jay.sf
  • 60,139
  • 8
  • 53
  • 110
EdytaM
  • 21
  • 3

1 Answers1

0

I have exactly the same question. For what I've been able to learn, LSCV seems to perform poorly (or simply fail miserably) if the number of relocations is too large (Hemson et al 2005 Journal of Animal Ecology 2005. 74, 455–463). Mine is huge and at the beginning R session aborted when I tried to run the KDE with hLSCV, although all worked well with ref.

When I reduce the sample I got the error that you asked about. Reducing it further, I started to get a new error:

In .kernelUDs(SpatialPoints(x, proj4string = CRS(as.character(pfs1))),  :
  The algorithm did not converge within the specified range of hlim:
  try to increase it

No matter how high I set him it did not converge. A possible solution for this is to add noise to the relocationswith the function "jitter" as explained here: https://ecosystems.psu.edu/research/labs/walter-lab/manual/home-range-estimation/link-to-pdf and here https://animov.faunalia.narkive.com/NnG9nLKl/again-kernelud-and-lscv

It did not work for me, though, but I hope this helps anyone

oszkar
  • 865
  • 5
  • 21