Fit and select only two models

75 views
Skip to first unread message

Jenny Hansen

unread,
Aug 13, 2020, 4:06:03 AM8/13/20
to ctmm R user group
Hi Chris,
  After fitting movement models to 278 animal years of data, I discovered that 267 were OUF anisotropic and 10 were OUF isotropic (1 OU anisotropic). I have to repeat this process for 351 animal years of data. I would like to circumvent the "guess" process and specify fitting and selection of the two most likely model candidates. I have tried various methods of passing these model types to the ctmm.fit function with no luck. e.g.

oufModel <- ctmm.fit(bearTelem[[i]], m.ouf)

Can you help me with the code required for fitting only the two OUF models and passing that to ctmm.select afterward? Using the standard guess method takes 3.5 days to cycle through all my data and it would be very nice to be able to speed up the process, considering I know these are range-resident animals.

Thanks so much in advance,
Jenny

Christen Fleming

unread,
Aug 13, 2020, 2:00:17 PM8/13/20
to ctmm R user group
Hi Jenny,

Why doesn't the code oufModel <- ctmm.fit(bearTelem[[i]], m.ouf) work? Is the first argument a telemetry object and the second argument a ctmm object? That should work.

You can do model selection manually. For instance, each fit object will have an AICc slot, and you can take the lowest value. summary() on a list of fit objects will also rank them by the IC argument ("AICc" by default). I also have an internal function to sort lists of model fits, which I can export if you want. That way you can make a list of whatever fitted models you want to consider, run it through the sort function, and then take the first model in the list.

A bigger change you can make to reduce running time is to start with everything running in a for loop, and then when you get that working upgrade to a foreach loop parallelized over your CPU's cores. So if you have 8 cores and it takes 3.5 days to run on 1 core, then it would take half a day running on 7 cores.

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