Overlap error

37 views
Skip to first unread message

Malakhi Spint

unread,
May 30, 2024, 4:19:40 PMMay 30
to ctmm R user group
Hey guys, I've been working with ctmm and I've ran into a problem with the overlap function. Whenever I try to overlap two models, I get an error of inconsistent projections. They have the same exact projection, and I have reprojected the multiple times and I'm a little lost. 

I would be grateful for some more insight on this problem. Here's a snippet of my code

ctmm::projection(bear1_tele) <- ctmm::projection(bears_list)
ctmm::projection(bear2_tele) <- ctmm::projection(bears_list)

GUESS <- ctmm.guess(bear1_tele, interactive = TRUE)
FIT_OUF1 <- ctmm::ctmm.select(bear1_tele, GUESS,
                        method = "pHREML", verbose = TRUE)
FIT_OUF2<- ctmm::ctmm.select(bear2_tele, GUESS,
                       method = "pHREML", verbose = TRUE)

overlap_list<- list(FIT_OUF1, FIT_OUF2)

overlap <- ctmm::overlap(list(overlap_list, level = 0.95))

Best-
Malakhi

Christen Fleming

unread,
Jun 10, 2024, 6:45:53 PMJun 10
to ctmm R user group
Hi Malakhi,

Sorry for the delay.

It looks like you are calling overlap() on an object with the structure list(list(list(ctmm,...),list( ctmm,... )),numeric)
overlap() doesn't know how to handle this argument, and it fails the grid structure test, so that is the error that is returned.

You probably want something like: overlap( list(FIT_OUF1[[1]], FIT_OUF2[[2]]) )
  1. verbose=TRUE outputs a list of all candidate models, where you only want to compare the selected model.
  2. You wrapped your overlap() argument in an extra list.
Also, this is the overlap between the Gaussian distributions and not the overlap between the AKDEs. That may not be what you want.

Best,
Chris

Malakhi Spint

unread,
Jun 11, 2024, 1:54:33 PMJun 11
to ctmm R user group
Hi Chris,

I see where my mistake was. I ended up getting it to work but encountered another error about null sigma values, but by the sounds of it, this overlap isn't exactly what I'm looking for. Does ctmm provide a way to have a visual overlap with an overlap percentage? 

Best-
Malakhi

Christen Fleming

unread,
Jun 17, 2024, 12:15:41 AMJun 17
to ctmm R user group
Hi Malakhi,

To get the overlap between the full UDs, you just use the UDs in the function instead of the model fit objects.
The model fit objects should work without error, though.

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