Multiple ctmm's, error in akde, and OD estimates

593 views
Skip to first unread message

npg...@ncsu.edu

unread,
May 5, 2017, 11:12:38 AM5/5/17
to ctmm R user group

Hi Dr. Flemming et al. --


I'm hoping to ask a couple questions...  Thanks in advance!


I'd like to know if you've run multiple ctmm's on multiple animals/collars at once?  I'm not certain how that would work with having to store the "GUESS" estimates?  Would you recommend doing it manually?


Secondly, what would you suggest as the best way to add my GPS collar error to run a 'final' akde?  I have both GPS error and DOP for most of my locations/collar deployments.  I noticed that DOP is used quite often and it can be automatically incorporated in the model, but only if  using Movebank, correct?   My data are not yet on MoveBank.  Any recommendations here would be great?


Lastly, I working with identifying an objective method to set the dt.max parameter?  My OD's are very fragmented (hardly able to identify corridors) unless I set this value to 1500-3000 which is up to 40-50 times my average fix rate, which seems inappropriate (I have a flexible fix schedule with both 15 minute and 60 minutes fixes depending on where the animal is located).  Could 'tau' (HR crossing time) be used as a statistically independent time between locations for a reasonable dt.max value?   


Much appreciated.


Nick

Christen Fleming

unread,
May 5, 2017, 3:03:52 PM5/5/17
to ctmm R user group, npg...@ncsu.edu
Hi Nick,

1) You can change the name of the global variable that the guesstimate is stored in with the "name" argument. You can also spit out the default guesstimate with "interactive=FALSE". See help("variogram.fit")

2) The DOP column just needs to be named appropriately for as.telemetry() to import it correctly. During import you should see a message where as.telemetry() complains that it doesn't know the UERE value. From there, I suggest following the vignette("variogram") section on telemetry errors. If you also have calibration data see help('uere').

Also, there are some rendering issues with the variogram error model that should be fixed in the Github repository, which you can install with the command

devtools::install_github("ctmm-initiative/ctmm")

3) Internally, everything in ctmm is in SI units, so seconds for time. 60 minutes dt.max would be dt.max=60^2 or dt.max=3600, which is more that what you say you need. There is a new convenience function in the Github repository to help with this, so you could also do dt.max = 60 %#% "minutes" or dt.max = 1 %#% "hour" to avoid confusion.

As for using "tau", I had that idea too and that is what the "cor.min" argument does (see help('occurrence')). I'm not really sure what the best method to deal with this issue would be and I've never seen it resolved in the literature.

Best,
Chris

npg...@ncsu.edu

unread,
May 15, 2017, 4:21:03 PM5/15/17
to ctmm R user group, npg...@ncsu.edu

Hi Dr. Fleming --


Thanks for the help on the previous post! 


I have a few follow up questions below.


Thanks very much in advance.


Sincerely,


Nick



1.  My akde is taking a long time to run (hours on some data) to no avail.  It looks like both maximizing the likelihood and calculating the covariance both take between 7-10 minutes per animal (14-20 minutes of processing time), but the akde is the real time consumer.  Do you have any thoughts on this? 


2.  I cannot get my DOP to be recognized in my 'as.telemetry command.  It looks like the vignette is fairly straight forward from this point.  Any chance you could look at the attached screenshot of my code for 'as.telemetry'? 



3.  Also, I have attached a screenshot of one of the akde's for a male bear (vhf only).  Does it seem as though the 95% UD is too far from the points, given this animal was followed for ~ a year?  I know that the furthest point is from the upper 95% CI for the akde (not the mean estimate), but still it seems fairly inflated?  Do you have thoughts or suggestions? 



4.  I was hoping I could save one of the models for one of "my" (GPS data) male bears and apply it to this "vhf" male bear?  Have you seen that?  What would be the easiest way to do that, do you have reccs for this approach?

5.  I was planning to use cctmm's for seasonal HR analysis too?  However, I'm wondering if the ctmm is based on where this animal would likely go if it were followed for a year, I suspect it will inflate the seasonal HR? 


On Friday, May 5, 2017 at 11:12:38 AM UTC-4, npg...@ncsu.edu wrote:

Christen Fleming

unread,
May 16, 2017, 8:27:04 PM5/16/17
to ctmm R user group, npg...@ncsu.edu

Hi Nick,

1. It looks like you are using weights=TRUE in akde(). Slowdown is very likely because you have a minimum time difference of 2 minutes in the data you gave me. I am adding notes to help("bandwidth") on this---for weights=TRUE the minimum time difference is the default discretization resolution, so for your data the fast default algorithm scales like O(7.5 months/2 minutes) or O(164,000), as slow as having evenly sampled 164k locations. After fitting a model with error, I bumped dt up to 15 minutes with the data you sent me and it was very fast and looked good with trace=TRUE. Model fitting with error is much slower though.

I will also add that if you have large effective sample sizes like you do (~100) weights aren't really going to help unless the sample schedule is jacked up. Half way though this dataset, something weird does happen to your sampling schedule though...

2. From your script, it looks like you are taking some non-Movebank file and then converting it to a Move move object and then converting that to a ctmm telemetry object. However, the move object you are creating doesn't have the DOP column in it, so there's no way for it to carry over. I would suggest formatting your data to the Movebank standard and then converting that to a telemetry object instead, though there is probably some way to do this with move objects as well.

I fit your data with the DOP column and error=TRUE and the AIC dropped by 250. The initial part of the variogram now matches the model much better too.

3. Two things: (A) When you see AKDEs go well beyond the data like this, its saying that observed data isn't very exhaustive and future space us is expected to go well beyond the data. These bigger areas do cross validate better than narrower KDE areas, even though they lack much precision as you can see from the wide CIs. Mike Noonan is wrapping up a big multi-species comparison that demonstrates this on real data. (B) If this phenomena sticks out from the other data, your male bear probably dispersed at some point in the data, making this some combination of home range and dispersal range. You might consider segmenting the data to isolate range resident periods. In the future we will have models that help make this segmentation objective.

Also, even with the bear you sent me, it looked like the range slowly drifted in time as the variogram was gradually creeping upwards instead of leveling off. We will have better models for this eventually.

4. I'm not sure I understand the question, but you can fit models to VHF data. Often the result is OU or IID. Far in the future, we will have hierarchical fitting on populations, but for now I don't see what that would give you.

5. The basic models in ctmm are stationary, range resident models. If you put in pure home-range data, it gives you the ordinary home range, which is making roughly daily predictions for your bears. If you put in pure dispersal data, it gives you a dispersal range, which is a prediction over repeated dispersals (multiple years, perhaps, for male bears). If you put in a non-stationary mixture of behaviors, then you are getting out some kind of average, which may or may not make sense for your analysis. In the future, we will have more complex models, but for now this is a single behavior fit, and you need to segment the data if necessary.

Best,
Chris

npg...@ncsu.edu

unread,
May 17, 2017, 9:14:00 AM5/17/17
to ctmm R user group, npg...@ncsu.edu

Hi Dr. Flemming --


This is great, thanks very much for the detailed help.  I'm amazed at the quality of time you put in to 'our' questions!  I'm hoping to clarify a bit with some of your responses below.  I'll follow up using all CAPS.


I'm also a bit curious, with all the new models coming out in the ctmm package would you suggest waiting a bit before conducting space use analyses since there is so much rapid development?  I suspect not, but just thought I'd get your opinion.


Thanks much again.


Nick


On Tuesday, May 16, 2017 at 8:27:04 PM UTC-4, Christen Fleming wrote:

Hi Nick,

1. It looks like you are using weights=TRUE in akde(). Slowdown is very likely because you have a minimum time difference of 2 minutes in the data you gave me. I am adding notes to help("bandwidth") on this---for weights=TRUE the minimum time difference is the default discretization resolution, so for your data the fast default algorithm scales like O(7.5 months/2 minutes) or O(164,000), as slow as having evenly sampled 164k locations. After fitting a model with error, I bumped dt up to 15 minutes with the data you sent me and it was very fast and looked good with trace=TRUE. Model fitting with error is much slower though.

I'M NOT CERTAIN I FOLLOW THE MINIMUM 2 MINUTE TIME DIFFERENCE IN THE DATA SET I SENT TO YOU?  I'M SURE I AM MISUNDERSTANDING, BUT THE RELOCATIONS ARE 60 MIN APART.  YES, I WAS USING WEIGHTS=TRUE BECAUSE I HAVE SOME ANIMALS WHERE I NEEDED TO CHANGE THE FIX SCHEDULE TO INSURE THE COLLAR BATTERY DOES NOT DIE BEFORE THE END OF THE YEAR (E.G., DEN SEASON WHERE WE CAN SWAP A COLLAR OUT).  SO, YES, THE FIX SCHEDULE DOES CHANGE ON MANY OF MY ANIMALS AFTER ABOUT 6-9 MONTHS.  SHOULD I BE DOING SOMETHING DIFFERENTLY WITH THESE DATA? 
 
I WILL ONLY USE THE WEIGHTS=TRUE OPTION FOR THE VHF DATA SET I AM MAKING COMPARISONS TOO.  HOWEVER, I WILL SAY THAT USING WEIGHTS=TRUE PROVIDED A BETTER VISUAL 'FIT' FOR SOME OF MY HR'S.  THE FIT ABOVE LOOKS EXCELLENT.

I will also add that if you have large effective sample sizes like you do (~100) weights aren't really going to help unless the sample schedule is jacked up. Half way though this dataset, something weird does happen to your sampling schedule though...

2. From your script, it looks like you are taking some non-Movebank file and then converting it to a Move move object and then converting that to a ctmm telemetry object. However, the move object you are creating doesn't have the DOP column in it, so there's no way for it to carry over. I would suggest formatting your data to the Movebank standard and then converting that to a telemetry object instead, though there is probably some way to do this with move objects as well.

I fit your data with the DOP column and error=TRUE and the AIC dropped by 250. The initial part of the variogram now matches the model much better too.

YES, THAT IS WHAT I HAVE DONE.  HOW DID YOU GET THE DOP TO RUN?  DOING AS YOU SUGGESTED ABOVE AND SKIPPING THE MOVE OBJECT CREATION?  

3. Two things: (A) When you see AKDEs go well beyond the data like this, its saying that observed data isn't very exhaustive and future space us is expected to go well beyond the data. These bigger areas do cross validate better than narrower KDE areas, even though they lack much precision as you can see from the wide CIs. Mike Noonan is wrapping up a big multi-species comparison that demonstrates this on real data. (B) If this phenomena sticks out from the other data, your male bear probably dispersed at some point in the data, making this some combination of home range and dispersal range. You might consider segmenting the data to isolate range resident periods. In the future we will have models that help make this segmentation objective.

Also, even with the bear you sent me, it looked like the range slowly drifted in time as the variogram was gradually creeping upwards instead of leveling off. We will have better models for this eventually.

I DID NOTICE THAT AS WELL, BUT THIS IS AN OLDER  FEMALE WITH YEARLINGS THAT HAD/DOES HAVE A FAIRLY SMALL HR. 

4. I'm not sure I understand the question, but you can fit models to VHF data. Often the result is OU or IID. Far in the future, we will have hierarchical fitting on populations, but for now I don't see what that would give you.

SORRY, PROBABLY MY POOR COMMUNICATION.  YES, THE BEAR WITH THE WIDE CI'S I SENT A SCREENSHOT OF WAS FITTED WITH OU AND THIS WAS A VHF COLLARED MALE BEAR WITH ~ 80 LOCATIONS FOR AN ANNUAL PERIOD.  I WANTED TO KNOW IF I COULD USE A MODEL FIT TO ONE OF MY GPS DATA COLLARS (ALSO A MALE BEAR) AND FIT THAT MODEL TO THE MALE BEAR WITH VHF DATA?

5. The basic models in ctmm are stationary, range resident models. If you put in pure home-range data, it gives you the ordinary home range, which is making roughly daily predictions for your bears. If you put in pure dispersal data, it gives you a dispersal range, which is a prediction over repeated dispersals (multiple years, perhaps, for male bears). If you put in a non-stationary mixture of behaviors, then you are getting out some kind of average, which may or may not make sense for your analysis. In the future, we will have more complex models, but for now this is a single behavior fit, and you need to segment the data if necessary.

OKAY, I WILL PROCEED WITH WHAT VISUALLY DEPICTS RANGE RESIDENCY FOR MY SEASONAL ANALYSES TOO.

THANKS A LOT DR. FLEMMING.

Christen Fleming

unread,
May 18, 2017, 3:14:18 AM5/18/17
to ctmm R user group, npg...@ncsu.edu
Hi Nick,

I wouldn't wait on new models unless something is terribly wrong. There will always be new models. Its like buying a new cell phone.
The new models will allow for new inferences, which means new results and new papers.

In the data you sent me, most of the intervals were 60 minutes, but some were 15/30/45 minutes and there was at least one time interval that was 123 seconds (~2 minutes). This tiny time interval requires an error model for a proper fit because the telemetry error is comparable to the animal's movement within that span of time (which deflects the semi-variance function down if not accounted for), and it is also what was slowing down akde with weights=TRUE on default settings.

In the data you sent me, the sampling schedule did change abruptly like you said and so I would definitely recommend weights=TRUE with that kind of data---its exactly what the weights method was designed for. But with tiny time intervals, you will also need to consider the error model in fitting and dt argument of akde/bandwidth.

To get the DOP column imported I took your data.frame and added Movebank format columns for lat & lon, and fed in the timestamp format and timezone that you specified. See help('as.telemetry'). Making an intermediate move object was not necessary, though its probably possible to do that correctly---preserving all columns.

I don't see any reason to use a model fit from one animal on another. The issue is range residence, which is a property of the data. Fixing the model to be more range resident when the data are not doesn't make sense to me.

Best,
Chris

Nicholas Gould

unread,
May 18, 2017, 8:12:56 AM5/18/17
to Christen Fleming, ctmm R user group

Thanks Dr. Flemming, I appreciate the thorough response.  Very helpful.


Nick


-- --
Nicholas P. Gould
Graduate Research Associate
Department of Forestry and Environmental Resources
Fisheries, Wildlife, and Conservation Biology
North Carolina State University
Raleigh, NC 27613
npg...@ncsu.edu
(970) 988-2102 Mobile



From: ctmm...@googlegroups.com <ctmm...@googlegroups.com> on behalf of Christen Fleming <chris.h...@gmail.com>
Sent: Thursday, May 18, 2017 3:14 AM
To: ctmm R user group
Cc: npg...@ncsu.edu
Subject: Re: Multiple ctmm's, error in akde, and OD estimates
 
--
You received this message because you are subscribed to a topic in the Google Groups "ctmm R user group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ctmm-user/IjwEU6x1MSI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ctmm-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ctmm-user/4558fea2-dc5b-4873-9efc-6bcbca7654c2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Nicholas Gould

unread,
Jun 1, 2017, 1:58:41 PM6/1/17
to Christen Fleming, ctmm R user group

Hi Dr. Flemming --


I have put my data into movebank to make things a little easier (for me anyway).  However, I'm concerned that the error model is not running correctly?  It is the top model in most of the preliminary runs I've done so far, but I'm a little concerned that it's not reading the DOP column, but using homoscedastic errors instead.


Could you please provide some insight here?  


Thanks much.


Nick


-- --
Nicholas P. Gould
Graduate Research Associate
Department of Forestry and Environmental Resources
Fisheries, Wildlife, and Conservation Biology
North Carolina State University
Raleigh, NC 27613
npg...@ncsu.edu
(970) 988-2102 Mobile



From: ctmm...@googlegroups.com <ctmm...@googlegroups.com> on behalf of Nicholas Gould <ngo...@msn.com>
Sent: Thursday, May 18, 2017 8:12 AM
To: Christen Fleming; ctmm R user group

Christen Fleming

unread,
Jun 2, 2017, 12:13:23 PM6/2/17
to ctmm R user group, chris.h...@gmail.com, ngo...@msn.com
Hi Nick,

If the DOP values import correctly, you should see a message from as.telemetry about no UERE value specified. The telemetry object should also have an HDOP column (and possibly a VDOP column if you have altitude/depth data). You can see the object column names with names.

Best,
Chris
To unsubscribe from this group and all its topics, send an email to ctmm-user+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "ctmm R user group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ctmm-user/IjwEU6x1MSI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ctmm-user+unsubscribe@googlegroups.com.

Nicholas Gould

unread,
Jun 8, 2017, 9:13:07 AM6/8/17
to Christen Fleming, ctmm R user group

Thanks Chris, I appreciate the help.


Nick






From: Christen Fleming <chris.h...@gmail.com>
Sent: Friday, June 2, 2017 12:13 PM

To: ctmm R user group

Subject: Re: Multiple ctmm's, error in akde, and OD estimates
 
Hi Nick,

If the DOP values import correctly, you should see a message from as.telemetry about no UERE value specified. The telemetry object should also have an HDOP column (and possibly a VDOP column if you have altitude/depth data). You can see the object column names with names.

Best,
Chris

On Thursday, June 1, 2017 at 1:58:41 PM UTC-4, Nicholas Gould wrote:

Hi Dr. Flemming --


I have put my data into movebank to make things a little easier (for me anyway).  However, I'm concerned that the error model is not running correctly?  It is the top model in most of the preliminary runs I've done so far, but I'm a little concerned that it's not reading the DOP column, but using homoscedastic errors instead.


Could you please provide some insight here?  


Thanks much.


Nick






From: ctmm...@googlegroups.com <ctmm...@googlegroups.com> on behalf of Nicholas Gould <ngo...@msn.com>
Sent: Thursday, May 18, 2017 8:12 AM
To: Christen Fleming; ctmm R user group
Subject: Re: Multiple ctmm's, error in akde, and OD estimates
 

Thanks Dr. Flemming, I appreciate the thorough response.  Very helpful.


Nick




Nicholas Gould

unread,
Jul 17, 2017, 3:30:09 PM7/17/17
to Christen Fleming, ctmm R user group

Hi Chris --


I am making comparisons to some historical VHF telemetry data for black bears and wanted to get your thoughts on using an error model for these data?  Nearly all of my GPS data performed best under the error model (>90% of the time) using the DOP values, and I'd like to keep the movement models as similar as possible for the comparisons.  Do you suggest using homoscedastic error in the model for these data?  I am hesitant to do this because these are bears and by nature they do not spend much time out in the open.  Is there a way to use an averaged telemetry error value (e.g., 180 m) in the model?  Is it necessary to use an error model?


Any thoughts would be much appreciated.


Thanks.


Nick

Christen Fleming

unread,
Jul 18, 2017, 11:41:50 AM7/18/17
to ctmm R user group, chris.h...@gmail.com, ngo...@msn.com
Hi Nick,

I think the real danger with not using an error model is that error will be misspecified as movement and the real danger of using an error model is that movement will be misspecified as error. The former happens whenever you ignore error in error-filled data and the latter happens when you have a fine scale & tortuous mode of movement that is indistinguishable from error at the sampling scale. The ideal situation is to have a structured error model (with HDOP) and calibrated errors that don't have to be fit with the movement. When you need to model error is when it makes a difference to capture the error. Did it make a difference in your estimates for the individuals tracked with GPS? My experience is that coarsely sampled GPS data on large mammals does not really need an error model.

As for the average error, I'm not really sure what you mean that would be different from homoscedastic errors, which fits one error variance over the whole timeseries.

You can also fix the errors if you want, if you have some idea of what it should be, by giving your Movebank file an e-obs style error column.

Best,
Chris

Nicholas Gould

unread,
Jul 25, 2017, 8:59:52 AM7/25/17
to Christen Fleming, ctmm R user group

Hi Chris --


Thanks a lot, I appreciate the response and guidance. 


So, do you feel as though comparisons can be made (and justified) between these two data sets -- a data set using error in the models and one that does not use error in the models (i.e., the VHF data set I am comparing to my GPS data)?


Thanks again.


Nick


-- --
Nicholas P. Gould
Graduate Research Associate
Department of Forestry and Environmental Resources
Fisheries, Wildlife, and Conservation Biology
North Carolina State University
Raleigh, NC 27613
npg...@ncsu.edu
(970) 988-2102 Mobile



From: Christen Fleming <chris.h...@gmail.com>
Sent: Tuesday, July 18, 2017 11:41 AM

To: ctmm R user group
Cc: chris.h...@gmail.com; ngo...@msn.com
Subject: Re: VHF error models
 

Christen Fleming

unread,
Jul 25, 2017, 7:38:37 PM7/25/17
to ctmm R user group, chris.h...@gmail.com, ngo...@msn.com
Hi Nick,

Making comparisons between different kinds of data is one of the major selling points of continuous-time analysis. Its fine as long appropriate models are used for each.

Comparisons are less justified when your assumptions are broken on different datasets in different ways, inducing different biases.

Best,
Chris
Reply all
Reply to author
Forward
Message has been deleted
0 new messages