ctmm.loglike function

28 views
Skip to first unread message

Michela Coury

unread,
Aug 17, 2021, 2:04:39 PM8/17/21
to ctmm R user group
Hi Chris,

Attempting to run ctmm.loglike function in order to calculate AKDE pHREML
but I keep running into the error 
"Error in get (CTMM$mean) : invalid first arguement.

My code is below :
Male103.ctmm<- as.telemetry(move.spotted) # telemetry object for use in ctmm package, or use movebank csv
Guess<-ctmm.guess(Male103.ctmm,interactive=F)
FIT1<-ctmm.select(Male103.ctmm,Guess)
UD<-akde(Male103.ctmm,Guess)
plot(Male103.ctmm,UD=UD)
ctmm(tau=NULL,omega=F,isotropic=F,range=T,circle=F,error=F,axes=c('X','Y'))
ctmm.loglike(spotted2,FIT1,REML=F,profile=T,zero=0,verbose=F)
ctmm.fit(data,CTMM=ctmm(),method="pHREML",COV=TRUE,control=list(),trace=FALSE)
ctmm.select(data,CTMM,verbose=FALSE,level=1,IC="AICc",MSPE="position",trace=FALSE,cores=1,
            ...)

I most likely am missing something when it comes to the code as I am not amazing at this process.
Thanks for your time,

Mick

Christen Fleming

unread,
Aug 17, 2021, 3:52:55 PM8/17/21
to ctmm R user group
Hi Mick,

You don't need to run ctmm.loglike() directly, as it is run internally by ctmm.fit(). And usually you don't need to run ctmm.fit() directly, as it is run internally by ctmm.select().

But in your call to ctmm.loglike(), I can't see where spotted2 was defined. That function call looks okay, otherwise. In ctmm.fit(), you have axes=c('X','Y') in uppercase, whereas the default projected axes are lowercase. You also have default data and CTMM arguments in ctmm.fit() and ctmm.loglike(). None of the function calls after plot() should be necessary, though.

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