AKDE function not working

83 views
Skip to first unread message

Ingo Miller

unread,
Apr 6, 2021, 5:40:43 AM4/6/21
to ctmm R user group
Hi Chris,

after I ran ctmm.select() simultaneously for several animals, I get the follwing error (and my code before):

GUESS <- lapply(turtle.trj, function(b) ctmm.guess(b, CTMM = ctmm(error = 10),  interactive=FALSE))
FITS <- lapply(1:length(turtle.trj), function(i) ctmm.select(turtle.trj[[i]],GUESS[[i]], verbose=T,  trace = TRUE, cores = 2))

UDS <- akde(turtle.trj, FITS, weights=F, trace=T)

Error in akde(turtle.trj, FITS, weights = F, trace = T) : 
  CTMM argument is of class list
In addition: Warning message:
In mean.default(diff(r)) : argument is not numeric or logical: returning NA

I guess it's because I turned on verbose=T, but shouldn't AKDE automatically select the best model? I used the same code before and it worked fine. The only thing that's new is the error incorporation, but I accidentally ran FITS with verbose=F before and akde() worked for that object. 
Is it possible that there is a bug or do I have to use verbose=F now?

Cheers,
Ingo 


Christen Fleming

unread,
Apr 6, 2021, 1:31:31 PM4/6/21
to ctmm R user group
Hi Ingo,

You either need to have verbose=FALSE or make a second FITS list object that only has the selected models only from FITS. As it is, you have more than one fit object per telemetry object and akde() doesn't know what to do with that. I don't think this shouldn't have worked previously, if it did. I didn't code for that to work.

Best,
Chris
Reply all
Reply to author
Forward
0 new messages