akde error for CPF species with short tracking duration

227 views
Skip to first unread message

Chris Oosthuizen

unread,
Sep 13, 2022, 9:37:01 AM9/13/22
to ctmm R user group

Hi Chris,

Your 31 August post on ‘population range estimation’ with ctmm / pkde perfectly coincided with my search about this topic. Thanks for the developments in this regard.   

I am interested in the population UD (I have no interest in individual ranges) of a central place foraging penguin species. We collected GPS data for many individuals, but each individual was only tracked for a short duration (e.g., 5 to 7 days tracking duration per individual). While tracked, individuals make one to six trips to sea and return to the nest after each trip. Foraging ranges are short (10s of km). GPS locations are irregular, but I fitted a correlated random walk model to the GPS data to provide regular locations (currently at 5 minute intervals) for UD estimation (and other analysis).

I am only really interested in the at-sea UD. Each track is therefore split into ‘trips’, with locations at the nest removed from the data (thus creating gaps of up to several hours or days in the individual’s time series when the penguin is at the nest, depending on the breeding phase).

Given the short tracking duration animals are unlikely to cross the range many times. Nonetheless, I can create a population UD from a subset of animals tracked, but a few animals are problematic, leading to the following error in the adke calculation:

Error in akde(data[SUB], CTMM[SUB], VMM = VMM[SUB], R = R, SP = SP, SP.in = SP.in,  :

Data not in single coordinate system.

In addition: Warning message:

In akde(DATA[[j]], FITS[[j]], weights = F, grid = list(dr = 500)) :

Fit object returned. DOF[area] = 0.00083149293815065

 

I have made sure that my input data are in a single coordinate system (through the following code):

DATA <- as.telemetry(dat, projection = 'EPSG:32721')  # set projection

ctmm::projection(DATA)  # check projection

 

The problem probably comes in with

 Fit object returned. DOF[area] = 1.46116371815442e-05

This is the DOF[area] of the OUF anisotropic model, while the OUf anisotropic model is selected by AIC:

> summary(FITS[[4]])

                                   ΔAICc        ΔRMSPE (km)    DOF[area]
OUf anisotropic    0.000000      3.203200          7.214246e+00
OUΩ anisotropic    2.051910     3.203214          7.214232e+00
OUF anisotropic    2.051914      3.203235          1.461164e-05
OUf                          23.333096    5.466274          6.843009e+00
OUF                         25.365892    5.466270          6.843018e+00
OU anisotropic     2486.973621   3.782094        1.616644e+00
IID anisotropic     8799.216542   0.000000         4.310000e+02

I was under the impression that the OUf model will be used in akde, but it seems that the OUF model is creating the error? 

I include the example code here with 6 animals, one of which (id == "Nelson_Cre2_HP07") is creating this problem. 

I would be interested to know how can I better trouble shoot the analysis to determine the cause of the problem, and to find a solution of course, if there is one. 


exampledat6.rds
google group q.R

Christen Fleming

unread,
Sep 14, 2022, 3:54:11 AM9/14/22
to ctmm R user group
Hi Chris,

It would be faster and more accurate to use the irregularly sampled data in ctmm, which is partly what ctmm is designed for. For akde(), please see the weights argument in vignette('akde') that will optimize the weight of each time to account for the irregularity. You might also need to play with the arguments of variogram to make them look nice, but that will not impact the estimates. ctmm.fit/ctmm.select will just work.

I see a couple of issues in the code:
  1. You have GUESS <- ctmm.guess(DATA[[i]], interactive = T) instead of interactive=FALSE , which can overwrite the GUESS object with nothing. I'm guessing that doesn't happen here because manipulate can't run in the cluster socket or something.
  2. When running ctmm.select with verbose=TRUE you can just take the first fit in the list for the selected model, instead of having to name it.
  3. Then when running akde, you reference the entire list of candidate models rather than the single selected model, which is not what you want to do and is not coded for. This has the unintended consequence of the errors. I just changed FITS[[j]] to FITS[[j]][[1]] and it runs without errors.
Best,
Chris

Chris2

unread,
Sep 15, 2022, 11:28:44 AM9/15/22
to ctmm R user group
Hi Chris, appreciate the code corrections, and general advice!  I have run the code on two larger samples and both ran without error. 
Many thanks!
Reply all
Reply to author
Forward
0 new messages