From michelle.kastern at gmail.com Thu May 1 12:01:08 2014 From: michelle.kastern at gmail.com (Michelle Kastern) Date: Thu, 1 May 2014 12:01:08 +0200 Subject: [tlocoh-info] Seasonal differences Message-ID: Hello tLoCoH list, I have a very basic question that I am hoping one of you might be able to help with. I would like to know the seasonal differences of the home range distribution of the collared individuals in the study I am working on. However, I do not know if running tLoCoH with the time gaps is showing incorrectly areas where individuals spent long periods of time (dark blue spots). Basically I want to show dry and wet season over two years. Currently I have just split the data and ran the script but I think the 6 month gaps are affecting the hulls. Have any of you tried this or have suggestions on how best to deal with seasonal differences. Any help will be much appreciated. Kind regards, Michelle -------------- next part -------------- An HTML attachment was scrubbed... URL: From lyons.andy at gmail.com Tue May 6 09:54:31 2014 From: lyons.andy at gmail.com (Andy Lyons) Date: Tue, 06 May 2014 00:54:31 -0700 Subject: [tlocoh-info] Seasonal differences In-Reply-To: References: Message-ID: <53689537.10903@gmail.com> Hi Michelle, That's a good question. Expressed slightly more generally, it seems you're dealing with a dataset that has long temporal gaps in it, and wondering how those gaps will affect the construction of hulls and subsequent isopleths. Presumably you want to avoid generating hulls that cover areas where the individual wasn't seen, especially areas between two clusters of locations recorded at two different time periods. A few lengthy time gaps in a dataset shouldn't necessarily create spurious cross-overs in space use. You can of course analyze groups of points recorded at different seasons separately (e.g., rainy season year 1, rainy season year 2). Alternatively, you can analyze all the rainy season locations across multiple years as one group. If time is excluded in nearest neighbor selection (let s=0), hulls will be constructed around each point and the closest points in space (regardless of which year they fall in). If you include time, the points within the same season will be favored as nearest neighbors, because the temporal difference between two points collected a year apart will probably swamp out the distance in space (although it depends on the value of s of course). This will give you hulls that are local in space and time. In either case, the adaptive method for nearest neighbor selection will reduce the number of points used in hull construction in areas where the point density is low (e.g., outlying areas). Hope this helps. If you're getting results that don't look right, there might be another issue going on. Long time gaps, for example, can also create what appear to be outlying points merely because sampling was cut off before the individual had a chance to spend much time in the area. Good luck and let me know if you have any other questions. Best, Andy On 5/1/2014 3:01 AM, Michelle Kastern wrote: > Hello tLoCoH list, > > I have a very basic question that I am hoping one of you might be able > to help with. I would like to know the seasonal differences of the > home range distribution of the collared individuals in the study I am > working on. However, I do not know if running tLoCoH with the time > gaps is showing incorrectly areas where individuals spent long periods > of time (dark blue spots). Basically I want to show dry and wet season > over two years. Currently I have just split the data and ran the > script but I think the 6 month gaps are affecting the hulls. Have any > of you tried this or have suggestions on how best to deal with > seasonal differences. > > Any help will be much appreciated. > > Kind regards, > > Michelle > > > _______________________________________________ > Tlocoh-info mailing list > Tlocoh-info at lists.r-forge.r-project.org > http://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/tlocoh-info -- *Andy Lyons, PhD* Department of Environmental Science Policy and Management 137 Mulford Hall #3114 University of California at Berkeley Berkeley, CA 94720-3114 Phone: +1-510-325-5860 ajlyons at berkeley.edu http://www.andylyons.org http://tlocoh.r-forge.r-project.org http://www.novamodeler.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From anna.schweiger at nationalpark.ch Mon May 12 15:56:48 2014 From: anna.schweiger at nationalpark.ch (Anna Schweiger) Date: Mon, 12 May 2014 15:56:48 +0200 Subject: [tlocoh-info] parameter selection, resampling, thin bursts Message-ID: <002a01cf6dea$06e04690$14a0d3b0$@schweiger@nationalpark.ch> Dear T-LoCoH group, dear Andy First of all: I want to thank Andy and his colleagues for the great effort you are putting into T-LoCoH! I have started to use the package some weeks ago and I have to say, that I've hardly ever came across such a well explained tutorial (everything worked right from the start!)! Your publication is also really helpful and easy to follow and so are the R help files. Thank you so much! Good documentations make life a lot easier (and work fun)!!! However, I have a couple of questions I could not figure out myself. Maybe someone has some ideas on the following: 1. The first is a methodological question: I'm comparing the feeding areas of ibex and chamois in the summers of four consecutive years in one valley where they co-occur. For each year I have several (1-7) individuals per species. My assumptions are that individuals of the same species behave more similar then individuals of different species. In a first step, I chose the same values for s and a (I use the "a" method) for all individuals of the same species, across the years; i.e. all ibex have the same s and a value and all chamois another s and a value. However, I could also argue that the individuals of one species behave more similar in the same year than in the other years (maybe because of environmental variability). Therefore, I was wondering if selecting different s and a values for every year makes sense? In the end I'm extracting environmental data based on the polygons defined by what can be called "core feeding areas" (I select them based on duration of stay and number of separate visits). Then I compare the two species in GLMMs. So I'm basically pooling all ibex data (different ind, different years) and compare them to all chamois. I can account for the individual and yearly differences by including animal ID and year as a random effect. Still, I believe the parameters of all individuals from one species should be somewhat comparable. So far I could not quite get my head around this problem: Should I choose only one s and a value per species, or maybe only one for both species, or is it possible to vary s and a per year or even per individual? Do you have any suggestions? For me this is really tricky. My other questions are more technical: 2. I want to manually offset duplicate xy points in xyt.lxy. Is this possible? I want to avoid random offset when constructing hulls, to make the analysis repeatable. Maybe the explanation is somewhere in the help, but I couldn't find it. 3. I'm resampling my data by using lxy.thin.byfreq (common sampling interval should be 4h, some individuals have 2h, some 10 min frequencies). Now, I have some cases with time gaps of about 1 month. I would still like to include these data. Is it possible to split the data and include the two time periods separately? Can this be done by setting a value for tct in the auto.a method? I don't quite understand how tct works. 4. Again about resampling: As recommended in the help I thin bursts before resampling the data to a common time interval. I was wondering if the following is correct: First I inspect the sampling frequency plot with lxy.plot.freq. Then I thought: When tau.diff.max (default) = 0.02 and tau (median)=120 min, sampling frequencies between 117.6 - 122.4 should be fine. If I now see points in the plot with let's say delta t/tau = 0.95, then sampling frequency= 0.95*120= 108 min which is outside the range of tau.diff.max. In that case, should I set the threshold value in lxy.thin.bursts to thresh=0.98, to make sure all remaining points fall within the range 117.6 - 122.4? I think that having a sampling interval of 108 min in a dataset that should have 120 min is not uncommon and normally I would not think it is problematic. But I have only a very vague idea about the effects of such data intervals when the algorithms start working. Is it possible to provide any guidelines on thresholds for thinning bursts? 5. And related to the question above: Should I check and thin burst again after resampling to a new time interval (with the new range of tau values?)? 6. Generally, it is a bit hard for me to choose parameters based on visual interpretation (s, a, delta/tau etc. ). So far I came to the conclusion that this is the best I can do. However, I was wondering if there are any general arguments to support the choices one makes based on visual interpretation. Do you have an opinion on this? How could you argue (I'm thinking about future referees.)? I think that's it for the moment. I would really appreciate any help or comments! All the best, Anna P.S.: I'm not sure if this helps, but I think I came across some typos in the R help file. Just in case somebody is collecting them: xyt.lxy: To disable the checking for duplicate time stamps, pass dup.dt.check=TRUE. lxy.thin.bursts {tlocoh}: To identify whether there are bursts in a LoCoH-xy dataset, and the sampling frequency of those bursts (i.e., the value ... TBC ************************************************* P Please consider the environment before printing this email. -------------- next part -------------- An HTML attachment was scrubbed... URL: From wgetz at berkeley.edu Mon May 12 17:16:15 2014 From: wgetz at berkeley.edu (Wayne Marcus GETZ) Date: Mon, 12 May 2014 08:16:15 -0700 Subject: [tlocoh-info] parameter selection, resampling, thin bursts In-Reply-To: <5370d33a.508eec0a.420a.ffffdfcbSMTPIN_ADDED_BROKEN@mx.google.com> References: <5370d33a.508eec0a.420a.ffffdfcbSMTPIN_ADDED_BROKEN@mx.google.com> Message-ID: Hi Anna: Here is my response On Mon, May 12, 2014 at 6:56 AM, Anna Schweiger < anna.schweiger at nationalpark.ch> wrote: > Dear T-LoCoH group, dear Andy > > > > First of all: I want to thank Andy and his colleagues for the great effort > you are putting into T-LoCoH! I have started to use the package some weeks > ago and I have to say, that I?ve hardly ever came across such a well > explained tutorial (everything worked right from the start!)! Your > publication is also really helpful and easy to follow and so are the R help > files. Thank you so much! Good documentations make life a lot easier (and > work fun)!!! > > > > However, I have a couple of questions I could not figure out myself. Maybe > someone has some ideas on the following: > > > > 1. The first is a methodological question: I?m comparing the > feeding areas of ibex and chamois in the summers of four consecutive years > in one valley where they co-occur. For each year I have several (1-7) > individuals per species. My assumptions are that individuals of the same > species behave more similar then individuals of different species. In a > first step, I chose the same values for s and a (I use the ?a? method) for > all individuals of the same species, across the years; i.e. all ibex have > the same s and a value and all chamois another s and a value. However, I > could also argue that the individuals of one species behave more similar in > the same year than in the other years (maybe because of environmental > variability). Therefore, I was wondering if selecting different s and a > values for every year makes sense? In the end I?m extracting environmental > data based on the polygons defined by what can be called ?core feeding > areas? (I select them based on duration of stay and number of separate > visits). Then I compare the two species in GLMMs. So I?m basically pooling > all ibex data (different ind, different years) and compare them to all > chamois. I can account for the individual and yearly differences by > including animal ID and year as a random effect. Still, I believe the > parameters of all individuals from one species should be somewhat > comparable. So far I could not quite get my head around this problem: > Should I choose only one s and a value per species, or maybe only one for > both species, or is it possible to vary s and a per year or even per > individual? Do you have any suggestions? For me this is really tricky. > You need to use the same s and a values for all species. However, you can ask the question, how robust is my result to variations in a and s. Thus you could see if your result holds up for all a and s or breaks down as these change. If it does break down, then this break down might have some significant implications because the implication might be that differences emerge or disappear, as the case may be, when time is given more or less weighting > My other questions are more technical: > > > > 2. I want to manually offset duplicate xy points in xyt.lxy. Is > this possible? I want to avoid random offset when constructing hulls, to > make the analysis repeatable. Maybe the explanation is somewhere in the > help, but I couldn?t find it? > Since time is unique, I don't see how you can have overlapping points unless they are true duplicates. Such duplicates must be removed. So I am not sure I understand your question. > 3. I?m resampling my data by using lxy.thin.byfreq (common sampling > interval should be 4h, some individuals have 2h, some 10 min frequencies). > Now, I have some cases with time gaps of about 1 month. I would still like > to include these data. Is it possible to split the data and include the two > time periods separately? Can this be done by setting a value for tct in the > auto.a method? I don?t quite understand how tct works. > Andy will have to explain how this works. > 4. Again about resampling: As recommended in the help I thin bursts > before resampling the data to a common time interval. I was wondering if > the following is correct: First I inspect the sampling frequency plot with > lxy.plot.freq. Then I thought: When tau.diff.max (default) = 0.02 and tau > (median)=120 min, sampling frequencies between 117.6 - 122.4 should be > fine. If I now see points in the plot with let?s say delta t/tau = 0.95, > then sampling frequency= 0.95*120= 108 min which is outside the range of > tau.diff.max. In that case, should I set the threshold value in > lxy.thin.bursts to thresh=0.98, to make sure all remaining points fall > within the range 117.6 - 122.4? I think that having a sampling interval of > 108 min in a dataset that should have 120 min is not uncommon and normally > I would not think it is problematic. But I have only a very vague idea > about the effects of such data intervals when the algorithms start working. > Is it possible to provide any guidelines on thresholds for thinning bursts? > Again, Andy will have to explain how this works. > 5. And related to the question above: Should I check and thin burst > again after resampling to a new time interval (with the new range of tau > values?)? > > 6. Generally, it is a bit hard for me to choose parameters based on > visual interpretation (s, a, delta/tau etc. ). So far I came to the > conclusion that this is the best I can do. However, I was wondering if > there are any general arguments to support the choices one makes based on > visual interpretation. Do you have an opinion on this? How could you argue > (I?m thinking about future referees?)? > There are arguments that one can use to justify one choice over another. These are based on entropy concepts, but we have yet to discuss or implement these methods. So I cannot be more specific at this time. > I think that?s it for the moment. I would really appreciate any help or > comments! > Good luck and all the best wayne > > > All the best, > > > > Anna > > > > P.S.: I?m not sure if this helps, but I think I came across some typos in > the R help file. Just in case somebody is collecting them: > > xyt.lxy: To disable the checking for duplicate time stamps, pass > dup.dt.check=TRUE. > > lxy.thin.bursts {tlocoh}: To identify whether there are bursts in a > LoCoH-xy dataset, and the sampling frequency of those bursts (i.e., the > value ... TBC > > > > > > ************************************************* > > P Please consider the environment before printing this email. > > > > _______________________________________________ > Tlocoh-info mailing list > Tlocoh-info at lists.r-forge.r-project.org > http://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/tlocoh-info > > -- __________________________________________________________ ___________________________________________________________ Professor Wayne M. Getz A. Starker Leopold Professor of Wildlife Ecology Department Environmental Science Policy & Management 130 Mulford Hall University of California at Berkeley CA 94720-3112, USA Campus Visitors: My office is in 5052 VLSB Fax: ( (1-510) 666-2352 Office: (1-510) 642-8745 Lab: (1-510) 643-1227 email: wgetz at berkeley.edu lab: http://www.CNR.Berkeley.EDU/~getz/ ___________________________________________________________ ___________________________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: From lyons.andy at gmail.com Wed May 14 04:47:52 2014 From: lyons.andy at gmail.com (Andy Lyons) Date: Tue, 13 May 2014 19:47:52 -0700 Subject: [tlocoh-info] parameter selection, resampling, thin bursts In-Reply-To: References: <5370d33a.508eec0a.420a.ffffdfcbSMTPIN_ADDED_BROKEN@mx.google.com> Message-ID: <5372D958.3060202@gmail.com> Hi Anna, Thanks for your questions. I have also added some responses below. Andy On 5/12/2014 8:16 AM, Wayne Marcus GETZ wrote: > Hi Anna: > > Here is my response > > > On Mon, May 12, 2014 at 6:56 AM, Anna Schweiger > > wrote: > > Dear T-LoCoH group, dear Andy > > First of all: I want to thank Andy and his colleagues for the > great effort you are putting into T-LoCoH! I have started to use > the package some weeks ago and I have to say, that I've hardly > ever came across such a well explained tutorial (everything worked > right from the start!)! Your publication is also really helpful > and easy to follow and so are the R help files. Thank you so much! > Good documentations make life a lot easier (and work fun)!!! > > However, I have a couple of questions I could not figure out > myself. Maybe someone has some ideas on the following: > > 1.The first is a methodological question: I'm comparing the > feeding areas of ibex and chamois in the summers of four > consecutive years in one valley where they co-occur. For each year > I have several (1-7) individuals per species. My assumptions are > that individuals of the same species behave more similar then > individuals of different species. In a first step, I chose the > same values for s and a (I use the "a" method) for all individuals > of the same species, across the years; i.e. all ibex have the same > s and a value and all chamois another s and a value. However, I > could also argue that the individuals of one species behave more > similar in the same year than in the other years (maybe because of > environmental variability). Therefore, I was wondering if > selecting different s and a values for every year makes sense? In > the end I'm extracting environmental data based on the polygons > defined by what can be called "core feeding areas" (I select them > based on duration of stay and number of separate visits). Then I > compare the two species in GLMMs. So I'm basically pooling all > ibex data (different ind, different years) and compare them to all > chamois. I can account for the individual and yearly differences > by including animal ID and year as a random effect. Still, I > believe the parameters of all individuals from one species should > be somewhat comparable. So far I could not quite get my head > around this problem: Should I choose only one s and a value per > species, or maybe only one for both species, or is it possible to > vary s and a per year or even per individual? Do you have any > suggestions? For me this is really tricky. > > > You need to use the same s and a values for all species. However, you > can ask the question, how robust is my result to variations in a and > s. Thus you could see if your result holds up for all a and s or > breaks down as these change. If it does break down, then this break > down might have some significant implications because the implication > might be that differences emerge or disappear, as the case may be, > when time is given more or less weighting I can see your quandary. I agree you need to be consistent across individuals or datasets that you categorize in one group for subsequent parts of the analysis. One way to be consistent is to use the same value of 's' and 'a', another way to be consistent is to use the same process for selecting 's' and 'a'. You've stumbled on one of T-LoCoH's functional limitations - there isn't a magic formula for finding the best 's' or 'a' (this can also be seen as a strength, because it keeps the analyst and system knowledge in the picture). An alternative way for selecting a value of 's', that you can apply consistently and fairly easily across all data sets, is to pick the 's' value that returns the same proportion of time selected hulls. This is a reasonable and defensible way of selecting s when you consider that the term in the time scaled distance equation that 's' controls is the essentially the distance the individual could have traveled in a given time period if it had been travelling at the maximum observed speed. In other words, two data sets that are in many ways similar (same species, same type of behavior) could have different values of 's' for the same time-distance balance, because maximum observed speed of a dataset is affected by sampling as well as behavior. I am currently of the belief that the best way to get a consistent balancing of space-time across data sets is to pick 's' that corresponds to a consistent proportion of time selected hulls (which will probably result in very close 's' values in absolute terms, we need to do some more work in this area). The same principle applies for selecting 'a' across datasets that should be analyzed in a similar manner - use the same value or the same process. If you define the optimal 'a' as the one that fills spurious holes in core areas, and minimizes cross-overs in areas where the animal wasn't seen (which are the principles we present in the paper), you'll probably find the same value of 'a' will do that pretty well across similar datasets (this again however presumes the data sampling is consistent, if sampling is greater in one dataset you'll obviously need larger values of 'a' for the same size hulls because it is a cumulative distance). Hope this helps. Let us know how it goes because parameter selection is one of the most common challenges when trying to create comparable space use models for different datasets (which all methods have to contend with). > My other questions are more technical: > > 2.I want to manually offset duplicate xy points in xyt.lxy. Is > this possible? I want to avoid random offset when constructing > hulls, to make the analysis repeatable. Maybe the explanation is > somewhere in the help, but I couldn't find it... > > Since time is unique, I don't see how you can have overlapping points > unless they are true duplicates. Such duplicates must be removed. So > I am not sure I understand your question. Duplicate locations with identical time stamps are usually a data processing error (which is why the function that creates a LoCoH-xy object from a series of locations checks for that). Duplicate locations with different time stamps are usually not an error, but the result of the animal resting, returning to the same spot, or a rounding issue. But even when the time stamps are different, duplicate locations can still be an issue with T-LoCoH because you need unique locations to make a polygon. The current version of T-LoCoH handles duplicate locations when creating hulls. There are two options based on the value of theoffset.dups parameter: ignoring them (at the risk of some points not having enough unique neighbors to draw a polygon), or randomly offsetting them by a fixed amount (the default). (The original LoCoH package had a third option, deleting them, which didn't seem like a good idea so it was removed). As an aside, we have discussed the possibility of adding another option in future versions of T-LoCoH, whereby different rules could be used to construct hulls around duplicate locations, for example constructing a circle with a fixed radius representing the size of the nest, water hole, etc. This would require some apriori knowledge of behavior when the animal is observed at the same location multiple times. If anyone has thoughts about this please let me know. The current version of T-LoCoH has an option to add a random offset (fixed distance, random direction) to duplicate locations when constructing hulls. This is a problem, as Anna points out, for reproducibility, because every time you construct hulls (and subsequently isopleths), the duplicate locations will be offset somewhat differently. An alternative approach is to randomly offset the duplicate locations before constructing hulls (i.e., in the Locoh-xy object). This should be done in full recognition that you are effectively altering the input data (which may be fine for home range construction, but for other analyses you would probably want to use the original locations). There is not a function in the T-LoCoH package to randomly offset duplicate locations in a LoCoH-xy object (I've added this to my to-do list). It can be done with the following commands: ## These commands illustrate how to apply a random offset to ## duplicate locations in LoCoH-xy object. Note that this ## can not be undone, and any subsequent analysis or construction ## of hulls will be based on the altered data. ## Given a LoCoH-xy object called fredo.lxy ## Get the coordinates of the Locoh-xy object xy <- coordinates(fredo.lxy$pts) ## Identify the duplicate rows dup_idx <- duplicated(x) ## See how many locations are duplicate table(dup_idx) ## Define the amount that duplicate locations will be randomly offset ## This is in map units. offset <- 1 ## Apply a random offset to the duplicate rows theta <- runif(n=sum(dup_idx), min=0, max=2*pi) xy[dup_idx,1] <- xy[dup_idx,1] + offset * cos(theta) xy[dup_idx,2] <- xy[dup_idx,2] + offset * sin(theta) ## See if there are any more duplicate rows. (Should all be false) table(duplicated(xy)) ## Next, we create a new SpatialPointsDataFrame by ## i. Grabbing the attribute table of the existing locations ## ii. Assigning the new locations (with offsets) as the locations pts_df <- fredo.lxy$pts at data coordinates(pts_df) <- xy fredo.lxy$pts <- pts_df ## The nearest neighbor lookup table is no longer valid and will need to be ## recreated. Likewise with the ptsh (proportion of time selected hulls v. s) table. ## Set these to null fredo.lxy$nn <- NULL fredo.lxy$ptsh <- NULL ## Lastly, we need to recreate the movement parameters. fredo.lxy <- lxy.repair(fredo.lxy) ## Should be done. Inspect results summary(fredo.lxy) plot(fredo.lxy) > 3.I'm resampling my data by using lxy.thin.byfreq (common sampling > interval should be 4h, some individuals have 2h, some 10 min > frequencies). Now, I have some cases with time gaps of about 1 > month. I would still like to include these data. Is it possible to > split the data and include the two time periods separately? Can > this be done by setting a value for tct in the auto.a method? I > don't quite understand how tct works. > I don't fully understand this question. lxy.thin.byfreq will selectively remove locations to get as close as it can to the desired sampling interval. If the desired sampling interval is 4 hours, and there is a gap of 30 days, it won't remove the points on either end of the gap. It will only remove points where sampling interval is higher than the desired interval. If you're seeing a different effect with lxy.thin.byfreq let me know. The tct argument in auto.a() function is very different, it acts a filter for identifying which points should be used in the computation of 'a' (doesn't remove any points). > Andy will have to explain how this works. > > 4.Again about resampling: As recommended in the help I thin bursts > before resampling the data to a common time interval. I was > wondering if the following is correct: First I inspect the > sampling frequency plot with lxy.plot.freq. Then I thought: When > tau.diff.max (default) = 0.02 and tau (median)=120 min, sampling > frequencies between 117.6 - 122.4 should be fine. If I now see > points in the plot with let's say delta t/tau = 0.95, then > sampling frequency= 0.95*120= 108 min which is outside the range > of tau.diff.max. In that case, should I set the threshold value in > lxy.thin.bursts to thresh=0.98, to make sure all remaining points > fall within the range 117.6 - 122.4? I think that having a > sampling interval of 108 min in a dataset that should have 120 min > is not uncommon and normally I would not think it is problematic. > But I have only a very vague idea about the effects of such data > intervals when the algorithms start working. Is it possible to > provide any guidelines on thresholds for thinning bursts? > I can see how that can be confusing. The tau.diff.max argument in the lxy.thin.bursts() function actually has nothing to do with how points within "a burst" are removed (which in this context refers to a series of locations spaced closely in time and presumed to be an error or artifact of a hyperactive GPS recording device), or how it identifies what group of points constitutes a burst. The tau.diff.max argument is used downstream, after points have been removed, in computing the movement parameters for the trajectory as a whole. The only argument which lxy.thin.bursts() defines a 'burst' is the thresh argument. If the median sampling interval of the data (not the desired interval, but the actual interval), is 120 minutes, and thresh = 0.05 (i.e., 6 minutes), then any pair of points sampled within 6 minutes of each other or less are considered to be part of a burst, and will be thinned down to a single point. Note if your ultimate goal is to resample the data to achieve a uniform sampling interval, thinning out bursts may not be necessary, the lxy.thin.byfreq() will do the same. The lxy.thin.byfreq() function basically lays down a time line of desired sampling times, based on the desired sampling interval, and then grabs the closest point in time to each one. It's a little more complicated than that but that's the gist of it. I should also note for reference that the way the term 'burst' in used T-LoCoH is quite different than how the term is used in the Move package and other movement analysis packages. > Again, Andy will have to explain how this works. > > 5.And related to the question above: Should I check and thin burst > again after resampling to a new time interval (with the new range > of tau values?)? > > After you resample to a uniform sampling interval, you shouldn't any sampling intervals substantially smaller than that (i.e., a burst, see above) > 6.Generally, it is a bit hard for me to choose parameters based on > visual interpretation (s, a, delta/tau etc. ). So far I came to > the conclusion that this is the best I can do. However, I was > wondering if there are any general arguments to support the > choices one makes based on visual interpretation. Do you have an > opinion on this? How could you argue (I'm thinking about future > referees...)? > Are you still speaking in terms of resampling? The graphs of sampling intervals, for example, are of course a guide. If you have a basis or theory for quantifying more rigorously the rules or criteria you want for resampling that would certainly be another way to do it. You can extract pretty much any statistical summaries you want from movement data. > There are arguments that one can use to justify one choice over > another. These are based on entropy concepts, but we have yet to > discuss or implement these methods. So I cannot be more specific at > this time. > > I think that's it for the moment. I would really appreciate any > help or comments! > > > Good luck and all the best > > wayne > > > All the best, > > Anna > > P.S.: I'm not sure if this helps, but I think I came across some > typos in the R help file. Just in case somebody is collecting them: > > xyt.lxy: To disable the checking for duplicate time stamps, pass > dup.dt.check=TRUE. > > lxy.thin.bursts {tlocoh}: To identify whether there are bursts in > a LoCoH-xy dataset, and the sampling frequency of those bursts > (i.e., the value ... TBC > > THANKS FOR FINDING THE TYPOS. I'M SURE THERE ARE MORE, PLEASE > KEEP SENDING THEM TO ME. > > ************************************************* > > PPlease consider the environment before printing this email. > > > _______________________________________________ > Tlocoh-info mailing list > Tlocoh-info at lists.r-forge.r-project.org > > http://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/tlocoh-info > > > > > -- > __________________________________________________________ > ___________________________________________________________ > > Professor Wayne M. Getz > A. Starker Leopold Professor of Wildlife Ecology > Department Environmental Science Policy & Management > 130 Mulford Hall > University of California at Berkeley > CA 94720-3112, USA > > Campus Visitors: My office is in 5052 VLSB > > Fax: ( (1-510) 666-2352 > Office: (1-510) 642-8745 > Lab: (1-510) 643-1227 > email: wgetz at berkeley.edu > lab: http://www.CNR.Berkeley.EDU/~getz/ > > ___________________________________________________________ > ___________________________________________________________ > > > > _______________________________________________ > Tlocoh-info mailing list > Tlocoh-info at lists.r-forge.r-project.org > http://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/tlocoh-info -------------- next part -------------- An HTML attachment was scrubbed... URL: From anna.schweiger at nationalpark.ch Thu May 15 23:14:19 2014 From: anna.schweiger at nationalpark.ch (Anna Schweiger) Date: Thu, 15 May 2014 23:14:19 +0200 Subject: [tlocoh-info] Tlocoh-info Digest, Vol 6, Issue 4 In-Reply-To: References: Message-ID: Hi Andy and Wayne Thanks a lot for your answers and advice. I learned a lot! I?ll probably try both options for parameter selection and let you know if I notice any interesting effects. So far I tried the ?same method? option, (i.e. I chose individual S values to select 60% time selected hulls for each ID )and noticed that the optimal A values (accordings to lhs.plot.isoarea, lhs.plot.isoarea and plotting the hulls) were really quite similar, so it was reasonable to choose 1 A value for all my IDs. Thanks also for the code for offsetting duplicate points! However, when I used it for an object with several ids, the code found more duplicate locations than I did with the summary function: > summary(all_gams.lxy) Summary of LoCoH-xy object: all_gams.lxy ***Locations id num.pts dups 528 252 0 611 223 0 655 90 0 643 235 0 620_11 243 1 620_12 231 1 > xy <- coordinates(all_gams.lxy$pts) > dup_idx <- duplicated(xy) > table(dup_idx) dup_idx FALSE TRUE 1269 5 I couldn?t figure out yet why this is the case so I chose to offset the points for 620_11 and 620_12 separately by using subsets. test1 <- lxy.subset (all_gams.lxy, id="620_12"). In the subsets, duplicated (xy) found only one duplicate per id (as in summary). Then, however another issues came up, when I tried to merge the objects back together lxy.merge(all_gams2.lxy,test1.lxy). I got the following error: Error: identicalCRS(dots) is not TRUE Seems like some problem with the coodinate system, that was not fixed with lxy.repair? I worked my way around it by recreating the lxy object, using the following instead instead of lxy.repair test1.lxy <- xyt.lxy(xy=xy, dt=pts_df$dt, id=pts_df$id, proj4string=CRS ("+proj=somerc +lat_0=46.95240555555556 +lon_0=7.439583333333333 +x_0=600000 +y_0=200000 +ellps=bessel +units=m +no_defs"),req.id=F, show.dup.dt=TRUE) That?s now fine for me. Still, it would interest my why duplicated (xy) finds different cases depending on whether I use a lxy object with several ids or a lxy object with just one id. I will try to find it out? Regarding your idea about constructing hulls around duplicate locations (e.g. a circle indicating a water hole), I think it might be quite a challenge to correctly identify ?real? duplicates due GPS accuracy. In my study area (mountains) I tested the accuracy of the GPS devices and found errors of about 8 m in open terrain and around 15 m in the forest. So, if I have 2 point with the same xy coordinates I cannot tell if the animal was actually in the same location, likewise if the xy points are only seperated a few meters I cannot rule out the possibility that the animal was in the same location. Also buffering would not help in that case. Maybe with additional physiological data (e.g. low heart rate when sleeping) it would be possible to find the ?real? duplicated points. Well, I guess my thoughts are trivial, but I?m curious what might be possible in the future. Many greetings, Anna On Wed, 14 May 2014 07:07:07 +0200 tlocoh-info-request at lists.r-forge.r-project.org wrote: > Send Tlocoh-info mailing list submissions to > tlocoh-info at lists.r-forge.r-project.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/tlocoh-info > > or, via email, send a message with subject or body 'help' to > tlocoh-info-request at lists.r-forge.r-project.org > > You can reach the person managing the list at > tlocoh-info-owner at lists.r-forge.r-project.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Tlocoh-info digest..." > > > Today's Topics: > > 1. Re: parameter selection, resampling, thin bursts (Andy Lyons) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 13 May 2014 19:47:52 -0700 >From: Andy Lyons > To: Anna Schweiger > Cc: tlocoh-info at lists.r-forge.r-project.org > Subject: Re: [tlocoh-info] parameter selection, resampling, thin > bursts > Message-ID: <5372D958.3060202 at gmail.com> > Content-Type: text/plain; charset="iso-8859-1"; Format="flowed" > > Hi Anna, > > Thanks for your questions. I have also added some responses below. > > Andy > > On 5/12/2014 8:16 AM, Wayne Marcus GETZ wrote: >> Hi Anna: >> >> Here is my response >> >> >> On Mon, May 12, 2014 at 6:56 AM, Anna Schweiger >>>> wrote: >> >> Dear T-LoCoH group, dear Andy >> >> First of all: I want to thank Andy and his colleagues for the >> great effort you are putting into T-LoCoH! I have started to use >> the package some weeks ago and I have to say, that I've hardly >> ever came across such a well explained tutorial (everything >>worked >> right from the start!)! Your publication is also really helpful >> and easy to follow and so are the R help files. Thank you so >>much! >> Good documentations make life a lot easier (and work fun)!!! >> >> However, I have a couple of questions I could not figure out >> myself. Maybe someone has some ideas on the following: >> >> 1.The first is a methodological question: I'm comparing the >> feeding areas of ibex and chamois in the summers of four >> consecutive years in one valley where they co-occur. For each >>year >> I have several (1-7) individuals per species. My assumptions are >> that individuals of the same species behave more similar then >> individuals of different species. In a first step, I chose the >> same values for s and a (I use the "a" method) for all >>individuals >> of the same species, across the years; i.e. all ibex have the >>same >> s and a value and all chamois another s and a value. However, I >> could also argue that the individuals of one species behave more >> similar in the same year than in the other years (maybe because >>of >> environmental variability). Therefore, I was wondering if >> selecting different s and a values for every year makes sense? In >> the end I'm extracting environmental data based on the polygons >> defined by what can be called "core feeding areas" (I select them >> based on duration of stay and number of separate visits). Then I >> compare the two species in GLMMs. So I'm basically pooling all >> ibex data (different ind, different years) and compare them to >>all >> chamois. I can account for the individual and yearly differences >> by including animal ID and year as a random effect. Still, I >> believe the parameters of all individuals from one species should >> be somewhat comparable. So far I could not quite get my head >> around this problem: Should I choose only one s and a value per >> species, or maybe only one for both species, or is it possible to >> vary s and a per year or even per individual? Do you have any >> suggestions? For me this is really tricky. >> >> >> You need to use the same s and a values for all species. However, >>you can ask the question, how robust is my result to variations in a >>and s. Thus you could see if your result holds up for all a and s or >>breaks down as these change. If it does break down, then this break >>down might have some significant implications because the implication >>might be that differences emerge or disappear, as the case may be, >>when time is given more or less weighting > > I can see your quandary. I agree you need to be consistent across >individuals or datasets that you categorize in one group for >subsequent parts of the analysis. One way to be consistent is to use >the same value of 's' and 'a', another way to be consistent is to use >the same process for selecting 's' and 'a'. You've stumbled on one of >T-LoCoH's functional limitations - there isn't a magic formula for >finding the best 's' or 'a' (this can also be seen as a strength, >because it keeps the analyst and system knowledge in the picture). An >alternative way for selecting a value of 's', that you can apply >consistently and fairly easily across all data sets, is to pick the >'s' value that returns the same proportion of time selected hulls. >This is a reasonable and defensible way of selecting s when you >consider that the term in the time scaled distance equation that 's' >controls is the essentially the distance the individual could have >traveled in a given time period if it had been travelling at the >maximum observed speed. In other words, two data sets that are in many >ways similar (same species, same type of behavior) could have >different values of 's' for the same time-distance balance, because >maximum observed speed of a dataset is affected by sampling as well as >behavior. I am currently of the belief that the best way to get a >consistent balancing of space-time across data sets is to > pick 's' that corresponds to a consistent proportion of time selected >hulls (which will probably result in very close 's' values in absolute >terms, we need to do some more work in this area). > > The same principle applies for selecting 'a' across datasets that >should be analyzed in a similar manner - use the same value or the >same process. If you define the optimal 'a' as the one that fills >spurious holes in core areas, and minimizes cross-overs in areas where >the animal wasn't seen (which are the principles we present in the >paper), you'll probably find the same value of 'a' will do that pretty >well across similar datasets (this again however presumes the data >sampling is consistent, if sampling is greater in one dataset you'll >obviously need larger values of 'a' for the same size hulls because it >is a cumulative distance). > > Hope this helps. Let us know how it goes because parameter selection >is > one of the most common challenges when trying to create comparable >space use models for different datasets (which all methods have to >contend with). > >> My other questions are more technical: >> >> 2.I want to manually offset duplicate xy points in xyt.lxy. Is >> this possible? I want to avoid random offset when constructing >> hulls, to make the analysis repeatable. Maybe the explanation is >> somewhere in the help, but I couldn't find it... >> >> Since time is unique, I don't see how you can have overlapping points >>unless they are true duplicates. Such duplicates must be removed. So >> I am not sure I understand your question. > > Duplicate locations with identical time stamps are usually a data >processing error (which is why the function that creates a LoCoH-xy >object from a series of locations checks for that). Duplicate >locations with different time stamps are usually not an error, but the >result of > the animal resting, returning to the same spot, or a rounding issue. >But even when the time stamps are different, duplicate locations can >still be an issue with T-LoCoH because you need unique locations to >make a polygon. > > The current version of T-LoCoH handles duplicate locations when >creating hulls. There are two options based on the value of >theoffset.dups parameter: ignoring them (at the risk of some points >not having enough unique neighbors to draw a polygon), or randomly >offsetting them by a > fixed amount (the default). (The original LoCoH package had a third >option, deleting them, which didn't seem like a good idea so it was >removed). As an aside, we have discussed the possibility of adding >another option in future versions of T-LoCoH, whereby different rules >could be used to construct hulls around duplicate locations, for >example constructing a circle with a fixed radius representing the >size of the nest, water hole, etc. This would require some apriori >knowledge of behavior when the animal is observed at the same location >multiple times. If anyone has thoughts about this please let me know. > > The current version of T-LoCoH has an option to add a random offset >(fixed distance, random direction) to duplicate locations when >constructing hulls. This is a problem, as Anna points out, for >reproducibility, because every time you construct hulls (and >subsequently isopleths), the duplicate locations will be offset >somewhat differently. An alternative approach is to randomly offset >the duplicate locations before constructing hulls (i.e., in the >Locoh-xy object). This should be done in full recognition that you are >effectively altering the input data (which may be fine for home range >construction, but for other analyses you would probably want to use >the original locations). There is not a function in the T-LoCoH >package to randomly offset duplicate locations in a LoCoH-xy object >(I've added this to my to-do list). It > can be done with the following commands: > > ## These commands illustrate how to apply a random offset to > ## duplicate locations in LoCoH-xy object. Note that this > ## can not be undone, and any subsequent analysis or construction > ## of hulls will be based on the altered data. > > ## Given a LoCoH-xy object called fredo.lxy > > ## Get the coordinates of the Locoh-xy object > xy <- coordinates(fredo.lxy$pts) > > ## Identify the duplicate rows > dup_idx <- duplicated(x) > > ## See how many locations are duplicate > table(dup_idx) > > ## Define the amount that duplicate locations will be randomly >offset > ## This is in map units. > offset <- 1 > > ## Apply a random offset to the duplicate rows > theta <- runif(n=sum(dup_idx), min=0, max=2*pi) > xy[dup_idx,1] <- xy[dup_idx,1] + offset * cos(theta) > xy[dup_idx,2] <- xy[dup_idx,2] + offset * sin(theta) > > ## See if there are any more duplicate rows. (Should all be false) > table(duplicated(xy)) > > ## Next, we create a new SpatialPointsDataFrame by > ## i. Grabbing the attribute table of the existing locations > ## ii. Assigning the new locations (with offsets) as the locations > > pts_df <- fredo.lxy$pts at data > coordinates(pts_df) <- xy > fredo.lxy$pts <- pts_df > > ## The nearest neighbor lookup table is no longer valid and will >need to be > ## recreated. Likewise with the ptsh (proportion of time selected >hulls v. s) table. > ## Set these to null > fredo.lxy$nn <- NULL > fredo.lxy$ptsh <- NULL > > ## Lastly, we need to recreate the movement parameters. > fredo.lxy <- lxy.repair(fredo.lxy) > > ## Should be done. Inspect results > summary(fredo.lxy) > plot(fredo.lxy) > >> 3.I'm resampling my data by using lxy.thin.byfreq (common >>sampling >> interval should be 4h, some individuals have 2h, some 10 min >> frequencies). Now, I have some cases with time gaps of about 1 >> month. I would still like to include these data. Is it possible >>to >> split the data and include the two time periods separately? Can >> this be done by setting a value for tct in the auto.a method? I >> don't quite understand how tct works. >> > I don't fully understand this question. lxy.thin.byfreq will >selectively remove locations to get as close as it can to the desired >sampling interval. If the desired sampling interval is 4 hours, and >there is a > gap of 30 days, it won't remove the points on either end of the gap. >It > will only remove points where sampling interval is higher than the >desired interval. If you're seeing a different effect with >lxy.thin.byfreq let me know. The tct argument in auto.a() function is > very different, it acts a filter for identifying which points should >be > used in the computation of 'a' (doesn't remove any points). > >> Andy will have to explain how this works. >> >> 4.Again about resampling: As recommended in the help I thin >>bursts >> before resampling the data to a common time interval. I was >> wondering if the following is correct: First I inspect the >> sampling frequency plot with lxy.plot.freq. Then I thought: When >> tau.diff.max (default) = 0.02 and tau (median)=120 min, sampling >> frequencies between 117.6 - 122.4 should be fine. If I now see >> points in the plot with let's say delta t/tau = 0.95, then >> sampling frequency= 0.95*120= 108 min which is outside the range >> of tau.diff.max. In that case, should I set the threshold value >>in >> lxy.thin.bursts to thresh=0.98, to make sure all remaining points >> fall within the range 117.6 - 122.4? I think that having a >> sampling interval of 108 min in a dataset that should have 120 >>min >> is not uncommon and normally I would not think it is problematic. >> But I have only a very vague idea about the effects of such data >> intervals when the algorithms start working. Is it possible to >> provide any guidelines on thresholds for thinning bursts? >> > > I can see how that can be confusing. The tau.diff.max argument in the >lxy.thin.bursts() function actually has nothing to do with how points >within "a burst" are removed (which in this context refers to a series >of locations spaced closely in time and presumed to be an error or >artifact of a hyperactive GPS recording device), or how it identifies >what group of points constitutes a burst. The tau.diff.max argument is > used downstream, after points have been removed, in computing the >movement parameters for the trajectory as a whole. The only argument >which lxy.thin.bursts() defines a 'burst' is the thresh argument. If >the median sampling interval of the data (not the desired interval, >but the actual interval), is 120 minutes, and thresh = 0.05 (i.e., 6 >minutes), then any pair of points sampled within 6 minutes of each >other or less are considered to be part of a burst, and will be >thinned down to a single point. > > Note if your ultimate goal is to resample the data to achieve a >uniform sampling interval, thinning out bursts may not be necessary, >the lxy.thin.byfreq() will do the same. The lxy.thin.byfreq() function >basically lays down a time line of desired sampling times, based on >the desired sampling interval, and then grabs the closest point in >time to > each one. It's a little more complicated than that but that's the >gist of it. > > I should also note for reference that the way the term 'burst' in >used T-LoCoH is quite different than how the term is used in the Move >package and other movement analysis packages. > > >> Again, Andy will have to explain how this works. >> >> 5.And related to the question above: Should I check and thin >>burst >> again after resampling to a new time interval (with the new range >> of tau values?)? >> >> > After you resample to a uniform sampling interval, you shouldn't any >sampling intervals substantially smaller than that (i.e., a burst, see >above) > >> 6.Generally, it is a bit hard for me to choose parameters based >>on >> visual interpretation (s, a, delta/tau etc. ). So far I came to >> the conclusion that this is the best I can do. However, I was >> wondering if there are any general arguments to support the >> choices one makes based on visual interpretation. Do you have an >> opinion on this? How could you argue (I'm thinking about future >> referees...)? >> > > Are you still speaking in terms of resampling? The graphs of sampling >intervals, for example, are of course a guide. If you have a basis or > theory for quantifying more rigorously the rules or criteria you want >for resampling that would certainly be another way to do it. You can >extract pretty much any statistical summaries you want from movement >data. > >> There are arguments that one can use to justify one choice over >>another. These are based on entropy concepts, but we have yet to >>discuss or implement these methods. So I cannot be more specific at >>this time. >> >> I think that's it for the moment. I would really appreciate any >> help or comments! >> >> >> Good luck and all the best >> >> wayne >> >> >> All the best, >> >> Anna >> >> P.S.: I'm not sure if this helps, but I think I came across some >> typos in the R help file. Just in case somebody is collecting >>them: >> >> xyt.lxy: To disable the checking for duplicate time stamps, pass >> dup.dt.check=TRUE. >> >> lxy.thin.bursts {tlocoh}: To identify whether there are bursts in >> a LoCoH-xy dataset, and the sampling frequency of those bursts >> (i.e., the value ... TBC >> >> THANKS FOR FINDING THE TYPOS. I'M SURE THERE ARE MORE, PLEASE >> KEEP SENDING THEM TO ME. >> >> ************************************************* >> >> PPlease consider the environment before printing this email. >> >> >> _______________________________________________ >> Tlocoh-info mailing list >> Tlocoh-info at lists.r-forge.r-project.org >> >> http://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/tlocoh-info >> >> >> >> >> -- >> __________________________________________________________ >> ___________________________________________________________ >> >> Professor Wayne M. Getz >> A. Starker Leopold Professor of Wildlife Ecology >> Department Environmental Science Policy & Management >> 130 Mulford Hall >> University of California at Berkeley >> CA 94720-3112, USA >> >> Campus Visitors: My office is in 5052 VLSB >> >> Fax: ( (1-510) 666-2352 >> Office: (1-510) 642-8745 >> Lab: (1-510) 643-1227 >> email: wgetz at berkeley.edu >> lab: http://www.CNR.Berkeley.EDU/~getz/ >> >> ___________________________________________________________ >> ___________________________________________________________ >> >> >> >> _______________________________________________ >> Tlocoh-info mailing list >> Tlocoh-info at lists.r-forge.r-project.org >> http://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/tlocoh-info > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > _______________________________________________ > Tlocoh-info mailing list > Tlocoh-info at lists.r-forge.r-project.org > http://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/tlocoh-info > > > End of Tlocoh-info Digest, Vol 6, Issue 4 > ***************************************** From anna.schweiger at nationalpark.ch Fri May 16 10:08:57 2014 From: anna.schweiger at nationalpark.ch (Anna Schweiger) Date: Fri, 16 May 2014 10:08:57 +0200 Subject: [tlocoh-info] nnsv_definition Message-ID: Hello again I couldn't find the explanation how the "normalisation" in nnsv works. Could somebody please explain and/or point towards the help topic where I can find it? Thanks a lot! Greetings. Anna From anna.schweiger at nationalpark.ch Fri May 16 10:47:23 2014 From: anna.schweiger at nationalpark.ch (Anna Schweiger) Date: Fri, 16 May 2014 10:47:23 +0200 Subject: [tlocoh-info] problem_solved_nnsv_definition Message-ID: Sorry, I wrote the previous mail too quick. I think I figured it out: nsv... number of seperate visit, e.g. between 1 and 20 visits (let 20 be the maximum) nnsv ... normalised by maximimum of seperate visits, value between 0 and 1, e.g. 8/20= 0.4. Don't want to flood the list....Greetings, Anna -------------- next part -------------- An embedded message was scrubbed... From: "Anna Schweiger" Subject: nnsv_definition Date: Fri, 16 May 2014 10:08:57 +0200 Size: 829 URL: From lyons.andy at gmail.com Fri May 16 19:18:28 2014 From: lyons.andy at gmail.com (Andy Lyons) Date: Fri, 16 May 2014 10:18:28 -0700 Subject: [tlocoh-info] parameter selection, resampling, thin bursts In-Reply-To: References: Message-ID: <53764864.5030206@gmail.com> Hi Anna, You're quite right, the code I sent you didn't take into account a Locoh-xy object that has multiple individuals. Duplicate locations for different individuals are of course fine and don't need to be offset because presumably you'll be constructing hulls for each individual separately. Hence the code I sent you and the summary() function report different numbers of duplicate locations. The code below has been modified to only offset duplicate locations for the same individual. Hope it works, and let me know if you have any difficulties or questions (all of which have been really helpful BTW). Andy ps: the error you were getting about the CRS being different is due to an annoying glitch (I believe) in the sp package where by a leading space gets inserted the proj4args string. I have it on my to do list to try figure out when/why it does this so I can trap the problem and remove the space which causes problems if you try later to merge the SpatialPointsDataFrames ## These commands illustrate how to apply a random offset to ## duplicate locations for the same individual in a LoCoH-xy object. ## Note that this can not be undone, and any subsequent analysis ## or constructionof hulls will be based on the modified data. ## Given a LoCoH-xy object called fredo.lxy ## Create a matrix containing the id, x-coord, and y-coord id_xy <- cbind(fredo.lxy$pts[["id"]], coordinates(fredo.lxy$pts)) ## Identify the duplicate rows dup_idx <- duplicated(id_xy) ## See how many locations are duplicate (all ids combined) table(dup_idx) ## Define the amount that duplicate locations will be randomly offset ## This is in map units (e.g., meters) offset <- 1 ## Apply a random offset to the duplicate rows theta <- runif(n=sum(dup_idx), min=0, max=2*pi) id_xy[dup_idx,2] <- id_xy[dup_idx,2] + offset * cos(theta) id_xy[dup_idx,3] <- id_xy[dup_idx,3] + offset * sin(theta) ## See if there are any more duplicate rows. (Should all be false) table(duplicated(id_xy)) ## Next, we create a new SpatialPointsDataFrame by ## i. Grabbing the attribute table of the existing locations ## ii. Assigning the new locations (with offsets) as the locations pts_df <- fredo.lxy$pts at data coordinates(pts_df) <- id_xy[, c(2,3)] fredo.lxy$pts <- pts_df ## The nearest neighbor lookup table is no longer valid and will need to be ## recreated. Likewise with the ptsh (proportion of time selected hulls v. s) table. ## Set these to null fredo.lxy$nn <- NULL fredo.lxy$ptsh <- NULL ## Lastly, we need to recreate the movement parameters. fredo.lxy <- lxy.repair(fredo.lxy) ## Should be done. Inspect results summary(fredo.lxy) plot(fredo.lxy) On 5/15/2014 2:14 PM, Anna Schweiger wrote: > Hi Andy and Wayne > > Thanks a lot for your answers and advice. I learned a lot! > > I?ll probably try both options for parameter selection and let you > know if I notice any interesting effects. So far I tried the ?same > method? option, (i.e. I chose individual S values to select 60% time > selected hulls for each ID )and noticed that the optimal A values > (accordings to lhs.plot.isoarea, lhs.plot.isoarea and plotting the > hulls) were really quite similar, so it was reasonable to choose 1 A > value for all my IDs. > > Thanks also for the code for offsetting duplicate points! However, > when I used it for an object with several ids, the code found more > duplicate locations than I did with the summary function: >> summary(all_gams.lxy) > Summary of LoCoH-xy object: all_gams.lxy > ***Locations > id num.pts dups > 528 252 0 > 611 223 0 > 655 90 0 > 643 235 0 > 620_11 243 1 > 620_12 231 1 > >> xy <- coordinates(all_gams.lxy$pts) >> dup_idx <- duplicated(xy) >> table(dup_idx) > dup_idx > FALSE TRUE > 1269 5 > > I couldn?t figure out yet why this is the case so I chose to offset > the points for 620_11 and 620_12 separately by using subsets. test1 > <- lxy.subset (all_gams.lxy, id="620_12"). In the subsets, duplicated > (xy) found only one duplicate per id (as in summary). Then, however > another issues came up, when I tried to merge the objects back > together lxy.merge(all_gams2.lxy,test1.lxy). I got the following > error: > Error: identicalCRS(dots) is not TRUE > Seems like some problem with the coodinate system, that was not fixed > with lxy.repair? I worked my way around it by recreating the lxy > object, using the following instead instead of lxy.repair > test1.lxy <- xyt.lxy(xy=xy, dt=pts_df$dt, id=pts_df$id, > proj4string=CRS ("+proj=somerc +lat_0=46.95240555555556 > +lon_0=7.439583333333333 +x_0=600000 +y_0=200000 +ellps=bessel > +units=m +no_defs"),req.id=F, show.dup.dt=TRUE) > That?s now fine for me. Still, it would interest my why duplicated > (xy) finds different cases depending on whether I use a lxy object > with several ids or a lxy object with just one id. I will try to find > it out? > > Regarding your idea about constructing hulls around duplicate locations > (e.g. a circle indicating a water hole), I think it might be quite a > challenge to correctly identify ?real? duplicates due GPS accuracy. In > my study area (mountains) I tested the accuracy of the GPS devices and > found errors of about 8 m in open terrain and around 15 m in > the forest. So, if I have 2 point with the same xy coordinates I > cannot tell if the animal was actually in the same location, likewise > if the xy points are only seperated a few meters I cannot rule out the > possibility that the animal was in the same location. Also buffering > would not help in that case. Maybe with additional physiological data > (e.g. low heart rate when sleeping) it would be possible to find the > ?real? duplicated points. Well, I guess my thoughts are trivial, but I?m > curious what might be possible in the future. > > Many greetings, Anna From lyons.andy at gmail.com Fri May 16 19:28:42 2014 From: lyons.andy at gmail.com (Andy Lyons) Date: Fri, 16 May 2014 10:28:42 -0700 Subject: [tlocoh-info] problem_solved_nnsv_definition In-Reply-To: References: Message-ID: <53764ACA.4030800@gmail.com> Actually the hull metric nnsv is the number of separate visits to a hull (where a separate visit is defined by the minimum inter-visit gap period parameter) divided by the _hull area_. Any hull metric that says 'normalized' means normalized by area. I'll add that to the hull metric description in the next update so it's more explicit. Andy On 5/16/2014 1:47 AM, Anna Schweiger wrote: > Sorry, I wrote the previous mail too quick. > I think I figured it out: nsv... number of seperate visit, e.g. > between 1 and 20 visits (let 20 be the maximum) > nnsv ... normalised by maximimum of seperate visits, value between 0 > and 1, e.g. 8/20= 0.4. > > Don't want to flood the list....Greetings, Anna > > > _______________________________________________ > Tlocoh-info mailing list > Tlocoh-info at lists.r-forge.r-project.org > http://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/tlocoh-info -------------- next part -------------- An HTML attachment was scrubbed... URL: From lyons.andy at gmail.com Mon May 19 09:52:46 2014 From: lyons.andy at gmail.com (Andy Lyons) Date: Mon, 19 May 2014 00:52:46 -0700 Subject: [tlocoh-info] T-LoCoH Hull Based Association Measures In-Reply-To: References: <535A7F11.9030908@gmail.com> Message-ID: <5379B84E.8040803@gmail.com> Hi Ambika, Thanks for your query. The general workflow for computing the mean centroid distance for temporally overlapping hulls (of two individuals) is below. More generally, if you find hull based measures of association like these useful, or have suggestions on how they could be made more useful or behavioral questions they could address, please let me know. Andy _ Data Prep__ _ 1. As needed, thin down your data so the sampling for the two individuals is roughly the same (i.e., start at the same time, end at the same time, and roughly the same sampling frequency). You can of course do this outside of R, but functions in the T-LoCoH package that were developed for this task include: lxy.merge() - merges two or more Locoh-xy objects so the locations for multiple individuals are saved in the same Locoh-xy object. If you imported the movement data for multiple individuals in one fell swoop (e.g., you imported a CSV file with a field for 'id' and turned that into a Locoh-xy object with the xyt.lxy() function), your data may already in a single Locoh-xy object. Merging the trajectories of multiple individuals into a single locoh-xy object will allow you to use the following two functions to view the sampling of each individual and make the sampling between two (or more) individuals as uniform as possible. lxy.plot.freq() - to plot the sampling frequency of the locations of multiple individuals, so you can see / verify when data collection for each individual began and ended, and also the sampling intervals. The Figures on pages 105 and 106 of my dissertation were created with this function and describe it a little further. lxy.thin.byfreq() - to selectively remove points from the trajectories of each individual to achieve a common start time, a common end time, and/or a common sampling intervals (or as close as you can get). _Creating Hulls__ _ Next step is to create hullsets for individual. This involves picking values for 's' and 'a' (or 'k'), as described in the tutorial. You may wish to use the same value of 's' for all the individuals, or different values based on a common selection process / principles. Given a single Locoh-xy object with the locations for multiple individuals, you can create the hullsets one-by-one by passing a value for the 'id' argument in the lxy.lhs() function. It will probably help to create isopleths (i.e., merged hulls) for the purposes of selecting value(s) of a or k, but note that the metrics for temporally overlapping and spatially overlapping hulls (that we'll create below) are based on the individual hulls only. _Merging Hullsets__(if needed) _ If you created separate Locoh-hullset objects for the different individuals, merge them together into a single Locoh-hullset object using the lhs.merge() function. So for example if you are looking at three individuals, you want to wind up with a Locoh-hullset object that has hulls for three individuals (which can be based on different parameters values of s, a, k) _Creating metrics for temporally overlapping hulls__ _ Finally, you can create hull metrics for the mean centroid distance of temporally overlapping hulls for pairs of individuals. You do this with the lhs.to.add() function. Take note that these metrics are pairwise. For example if you had hulls for individuals A, B, and C in the same hullset, then after you run the function that were would be two new metrics for individual A - the mean centroid distance for each one of A's hulls that overlap in time with individual B, and the mean centroid distance for hulls that overlap in time with individual C. Likewise for the other two individuals. You can control what it means to be "temporally overlapping" with the maxdt argument, noting that the time stamp of each hull is the time stamp of the parent point. When data sampling for two individuals is the same (e.g., one location per hour), then in most cases there will be only one hull that overlaps in time (although it depends on how you set the maxdt argument). In these cases, the "mean centroid distance" the value of a single centroid-to-centroid distance. The mean centroid distance for a pair of individuals will normally be reciprocal, in other words the mcd of individual A with respect to individual C will be the same as the mcd of individual C with respect to A. You don't have to compute the mean centroid distance for every pair of individuals (although it doesn't take long), rather you can specify which pairs to analyze using the id and hs2.id arguments. Note also in many cases the mean centroid distance of temporally overlapping hulls will similar to the time matched point-to-point distance of two individuals. It would be worth reflecting upon, and articulating, the rationale for using mean centroid distance of hulls v. the simpler point-to-point distance. _Creating Metrics for Spatially Overlapping Hulls__ _ See function lhs.so.add(). This function can be slow because it has to first identify which hulls from each individual overlap, which is time consuming (in its current form). Similar to the hull metric for temporally overlapping hulls, spatially overlapping hull metrics are created for pairs of individuals. See the function help page for details. On 5/13/2014 10:22 AM, Ambika Kamath wrote: > Hi Andy, > > Thank you very much for your rapid response! I seem to have gotten > gpclib to install, and the association metrics you describe definitely > look useful. The mean centroid distance between temporally overlapping > hulls is primarily what I'd want to calculate, but the other metrics > seem very interesting as well. Are there functions within T-LoCoH to > calculate these metrics, or will it be more complicated than that? I'm > not quite sure where to begin--if there's any documentation you could > point me to, that would be great! > > Many thanks again, > Ambika > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjanke at sulross.edu Mon May 26 23:18:12 2014 From: tjanke at sulross.edu (Thomas Janke) Date: Mon, 26 May 2014 21:18:12 +0000 Subject: [tlocoh-info] Dealing w/ multiple datasets Message-ID: <58862834A696BF4CA83ABDD585FD1C130C672450@mailstoreEx2010.srsu.edu> Andy, My name is Thomas Janke. I am a graduate student at Sul Ross State University in west Texas working for the Borderlands Research Institute. Over the past 3 years, I have been monitoring the movements and survival of reintroduced desert bighorn sheep to part of their historic range. Now comes time for the analysis and writing. After diving into past research and methodology, I knew I wanted to do more than just create and compare MCPs or KDEs to begin describing my research. Which brings me to you and your T_LoCoH software. I believe it is great y'all were able to create a software package that incorporates time into the analysis. I am new to this software, but am willing to do what it takes to become more familiarized with it and be able to incorporate it into my data analysis. I have read your dissertation, your Home Range Plus publication, and the overview of the T_LoCoH program, along with following through with the example sets. Now its time for me to start analyzing my data. We conducted 2 consecutive releases (2010 & 2011) for this restoration effort. I currently have data from 54 GPS collars, with data collection ranging from <1wk to >2yrs. Over the course of the study, we used 3 different types of collars (all of which have differing data formats). The 2010 released collars collected data in Lat/Long and were programmed to obtain a location every 3 hours. The 2011 released collars collected data in UTMs and were programmed to collect a location every 5 hours. I would ultimately like to compare the movements and UDs by release year, sex, and time of year (ecological seasons). I would also like to use the GPS data to see if there are any preferred habitats (e.g. slope, aspect, terrain ruggedness, etc.) for the previously mentioned comparisons. It would also be great to be able to delineate 'travel corridor(s)' from the GPS data (esp. the sheep that were documented crossing international borders). How do I need to go about entering and analyzing all of my data? Is there a way to compute an 's', and an 'a or k' value that can be used on all of the sheep, or will I have to determine individual values? If I am able to combine the data sets, how to I need to go about the different coordinate systems? How do I deal with differing data set sizes (e.g. 1 month compared to 2 years) or collars that had different acquisition rates? Any help you're able to give would be most appreciated. Thanks and have a good one, Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: From anna.schweiger at nationalpark.ch Tue May 27 19:20:42 2014 From: anna.schweiger at nationalpark.ch (Anna Schweiger) Date: Tue, 27 May 2014 19:20:42 +0200 Subject: [tlocoh-info] Dealing with multiple datasets Digest, Vol 6, Issue 8 In-Reply-To: References: Message-ID: Hi Thomas, I was also recently thinking on how to deal with multiple datasets/multiple individuals. Thanks to Wayne?s and Andy?s responses I could get my head around it. The short version (at least in my case) is: Either use the same parameter values for all individuals or the same technique (the same treshold) to select the paramter values. You find the full responses here (see point 1): http://lists.r-forge.r-project.org/pipermail/tlocoh-info/2014-May/000013.html For me a good way to get started with was to follow the Tutorial on the TLoCoH homepage with my own data. In the tutorial most initial issues are covered (coordinate systems, data import). Have you already seen it? http://tlocoh.r-forge.r-project.org/tlocoh_tutorial_2013-09-22.pdf Regarding coordinate system: I think you have to decide on one. Maybe it?s best to use the coordinate system of your environmental data. If you are working with raster data, it?s nice to avoid reprojecting them. While reprojecting trajectories or points is quite straight forward, raster reprojection involves two steps 1) project the cell centers into the new CRS 2) resample the cell values into a regular grid system. So, I always choose to reproject points, lines, polygons and not raster. If you have differing sampling schemes, you can resample the data to a common frequency (using xy.thin.byfreq). For example: > ibex.4h.lxy <- lxy.thin.byfreq (ibex.lxy, trim.ends=FALSE, samp.freq=14400, status=T) # resamples my data on ibex, with sampling frequencies of 10 min, 2 h and 4 h to a common interval of 4 h (14400 seconds) As far as I understood it, differing data set sizes (e.g. 1 month compared to 2 years) are not problematic, because if you include time in your analysis (s > 0), two points have to be close in time as well as close in space to be considered as nearest neighbours. Of course, if you are comparing individuals, the times (biological seasons) have to be matched between individuals and you have to have enough locations for nearest neighbours calculations (I chose to include only indiv. with more than 90 fixes after resampling to a common frequency). Hope it helps a bit. Good luck with your analysis! Cheers, Anna On Tue, 27 May 2014 12:00:11 +0200 tlocoh-info-request at lists.r-forge.r-project.org wrote: > Send Tlocoh-info mailing list submissions to > tlocoh-info at lists.r-forge.r-project.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/tlocoh-info > > or, via email, send a message with subject or body 'help' to > tlocoh-info-request at lists.r-forge.r-project.org > > You can reach the person managing the list at > tlocoh-info-owner at lists.r-forge.r-project.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Tlocoh-info digest..." > > > Today's Topics: > > 1. Dealing w/ multiple datasets (Thomas Janke) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Mon, 26 May 2014 21:18:12 +0000 >From: Thomas Janke > To: "tlocoh-info at lists.r-forge.r-project.org" > > Subject: [tlocoh-info] Dealing w/ multiple datasets > Message-ID: > <58862834A696BF4CA83ABDD585FD1C130C672450 at mailstoreEx2010.srsu.edu> > Content-Type: text/plain; charset="iso-8859-1" > > Andy, > > > > My name is Thomas Janke. I am a graduate student at Sul Ross State >University in west Texas working for the Borderlands Research >Institute. Over the past 3 years, I have been monitoring the >movements and survival of reintroduced desert bighorn sheep to part >of their historic range. Now comes time for the analysis and writing. > > > > After diving into past research and methodology, I knew I wanted to >do more than just create and compare MCPs or KDEs to begin describing >my research. Which brings me to you and your T_LoCoH software. I >believe it is great y'all were able to create a software package that >incorporates time into the analysis. > > > > I am new to this software, but am willing to do what it takes to >become more familiarized with it and be able to incorporate it into >my data analysis. I have read your dissertation, your Home Range Plus >publication, and the overview of the T_LoCoH program, along with >following through with the example sets. Now its time for me to start >analyzing my data. > > > > We conducted 2 consecutive releases (2010 & 2011) for this >restoration effort. I currently have data from 54 GPS collars, with >data collection ranging from <1wk to >2yrs. Over the course of the >study, we used 3 different types of collars (all of which have >differing data formats). The 2010 released collars collected data in >Lat/Long and were programmed to obtain a location every 3 hours. The >2011 released collars collected data in UTMs and were programmed to >collect a location every 5 hours. > > > > I would ultimately like to compare the movements and UDs by release >year, sex, and time of year (ecological seasons). I would also like >to use the GPS data to see if there are any preferred habitats (e.g. >slope, aspect, terrain ruggedness, etc.) for the previously mentioned >comparisons. It would also be great to be able to delineate 'travel >corridor(s)' from the GPS data (esp. the sheep that were documented >crossing international borders). > > > > How do I need to go about entering and analyzing all of my data? Is >there a way to compute an 's', and an 'a or k' value that can be used >on all of the sheep, or will I have to determine individual values? >If I am able to combine the data sets, how to I need to go about the >different coordinate systems? How do I deal with differing data set >sizes (e.g. 1 month compared to 2 years) or collars that had >different acquisition rates? > > > > Any help you're able to give would be most appreciated. > > > > Thanks and have a good one, > > > > > > Thomas > > > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > _______________________________________________ > Tlocoh-info mailing list > Tlocoh-info at lists.r-forge.r-project.org > http://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/tlocoh-info > > > End of Tlocoh-info Digest, Vol 6, Issue 8 > ***************************************** From tjanke at sulross.edu Tue May 27 22:48:21 2014 From: tjanke at sulross.edu (Thomas Janke) Date: Tue, 27 May 2014 20:48:21 +0000 Subject: [tlocoh-info] Dealing with multiple datasets Digest, Vol 6, Issue 8 In-Reply-To: References: , Message-ID: <58862834A696BF4CA83ABDD585FD1C130C672688@mailstoreEx2010.srsu.edu> Anne, I appreciate the response and help. I am still confused on the methods of computing a 's' and 'a' value for all of my datasets. Do I need to merge the data into 1 CSV doc and separate them by a Freq column, or do I need to individually load the datasets and run one-by-one or at the same time? Also, I have read and practiced the tutorial, it was helpful, but still only looked at one animal's data set in that example. As far as the coordinate system, I believe I am going to have everything calculated in UTMs. I will also try and figure out the resampling protocol to work with all of my datasets. Thanks and have a good one, Thomas ________________________________________ From: tlocoh-info-bounces at lists.r-forge.r-project.org [tlocoh-info-bounces at lists.r-forge.r-project.org] on behalf of Anna Schweiger [anna.schweiger at nationalpark.ch] Sent: Tuesday, May 27, 2014 12:20 PM To: tlocoh-info at lists.r-forge.r-project.org Subject: Re: [tlocoh-info] Dealing with multiple datasets Digest, Vol 6, Issue 8 Hi Thomas, I was also recently thinking on how to deal with multiple datasets/multiple individuals. Thanks to Wayne?s and Andy?s responses I could get my head around it. The short version (at least in my case) is: Either use the same parameter values for all individuals or the same technique (the same treshold) to select the paramter values. You find the full responses here (see point 1): http://lists.r-forge.r-project.org/pipermail/tlocoh-info/2014-May/000013.html For me a good way to get started with was to follow the Tutorial on the TLoCoH homepage with my own data. In the tutorial most initial issues are covered (coordinate systems, data import). Have you already seen it? http://tlocoh.r-forge.r-project.org/tlocoh_tutorial_2013-09-22.pdf Regarding coordinate system: I think you have to decide on one. Maybe it?s best to use the coordinate system of your environmental data. If you are working with raster data, it?s nice to avoid reprojecting them. While reprojecting trajectories or points is quite straight forward, raster reprojection involves two steps 1) project the cell centers into the new CRS 2) resample the cell values into a regular grid system. So, I always choose to reproject points, lines, polygons and not raster. If you have differing sampling schemes, you can resample the data to a common frequency (using xy.thin.byfreq). For example: > ibex.4h.lxy <- lxy.thin.byfreq (ibex.lxy, trim.ends=FALSE, samp.freq=14400, status=T) # resamples my data on ibex, with sampling frequencies of 10 min, 2 h and 4 h to a common interval of 4 h (14400 seconds) As far as I understood it, differing data set sizes (e.g. 1 month compared to 2 years) are not problematic, because if you include time in your analysis (s > 0), two points have to be close in time as well as close in space to be considered as nearest neighbours. Of course, if you are comparing individuals, the times (biological seasons) have to be matched between individuals and you have to have enough locations for nearest neighbours calculations (I chose to include only indiv. with more than 90 fixes after resampling to a common frequency). Hope it helps a bit. Good luck with your analysis! Cheers, Anna On Tue, 27 May 2014 12:00:11 +0200 tlocoh-info-request at lists.r-forge.r-project.org wrote: > Send Tlocoh-info mailing list submissions to > tlocoh-info at lists.r-forge.r-project.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/tlocoh-info > > or, via email, send a message with subject or body 'help' to > tlocoh-info-request at lists.r-forge.r-project.org > > You can reach the person managing the list at > tlocoh-info-owner at lists.r-forge.r-project.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Tlocoh-info digest..." > > > Today's Topics: > > 1. Dealing w/ multiple datasets (Thomas Janke) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Mon, 26 May 2014 21:18:12 +0000 >From: Thomas Janke > To: "tlocoh-info at lists.r-forge.r-project.org" > > Subject: [tlocoh-info] Dealing w/ multiple datasets > Message-ID: > <58862834A696BF4CA83ABDD585FD1C130C672450 at mailstoreEx2010.srsu.edu> > Content-Type: text/plain; charset="iso-8859-1" > > Andy, > > > > My name is Thomas Janke. I am a graduate student at Sul Ross State >University in west Texas working for the Borderlands Research >Institute. Over the past 3 years, I have been monitoring the >movements and survival of reintroduced desert bighorn sheep to part >of their historic range. Now comes time for the analysis and writing. > > > > After diving into past research and methodology, I knew I wanted to >do more than just create and compare MCPs or KDEs to begin describing >my research. Which brings me to you and your T_LoCoH software. I >believe it is great y'all were able to create a software package that >incorporates time into the analysis. > > > > I am new to this software, but am willing to do what it takes to >become more familiarized with it and be able to incorporate it into >my data analysis. I have read your dissertation, your Home Range Plus >publication, and the overview of the T_LoCoH program, along with >following through with the example sets. Now its time for me to start >analyzing my data. > > > > We conducted 2 consecutive releases (2010 & 2011) for this >restoration effort. I currently have data from 54 GPS collars, with >data collection ranging from <1wk to >2yrs. Over the course of the >study, we used 3 different types of collars (all of which have >differing data formats). The 2010 released collars collected data in >Lat/Long and were programmed to obtain a location every 3 hours. The >2011 released collars collected data in UTMs and were programmed to >collect a location every 5 hours. > > > > I would ultimately like to compare the movements and UDs by release >year, sex, and time of year (ecological seasons). I would also like >to use the GPS data to see if there are any preferred habitats (e.g. >slope, aspect, terrain ruggedness, etc.) for the previously mentioned >comparisons. It would also be great to be able to delineate 'travel >corridor(s)' from the GPS data (esp. the sheep that were documented >crossing international borders). > > > > How do I need to go about entering and analyzing all of my data? Is >there a way to compute an 's', and an 'a or k' value that can be used >on all of the sheep, or will I have to determine individual values? >If I am able to combine the data sets, how to I need to go about the >different coordinate systems? How do I deal with differing data set >sizes (e.g. 1 month compared to 2 years) or collars that had >different acquisition rates? > > > > Any help you're able to give would be most appreciated. > > > > Thanks and have a good one, > > > > > > Thomas > > > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > _______________________________________________ > Tlocoh-info mailing list > Tlocoh-info at lists.r-forge.r-project.org > http://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/tlocoh-info > > > End of Tlocoh-info Digest, Vol 6, Issue 8 > ***************************************** _______________________________________________ Tlocoh-info mailing list Tlocoh-info at lists.r-forge.r-project.org http://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/tlocoh-info From wgetz at berkeley.edu Wed May 28 01:37:20 2014 From: wgetz at berkeley.edu (Wayne Getz) Date: Tue, 27 May 2014 16:37:20 -0700 Subject: [tlocoh-info] Dealing w/ multiple datasets In-Reply-To: <58862834A696BF4CA83ABDD585FD1C130C672450@mailstoreEx2010.srsu.edu> References: <58862834A696BF4CA83ABDD585FD1C130C672450@mailstoreEx2010.srsu.edu> Message-ID: Hi Tom: I am sure that Andy will respond when he gets a chance, but here are some comments: > Andy, > > My name is Thomas Janke. I am a graduate student at Sul Ross State University in west Texas working for the Borderlands Research Institute. Over the past 3 years, I have been monitoring the movements and survival of reintroduced desert bighorn sheep to part of their historic range. Now comes time for the analysis and writing. > > After diving into past research and methodology, I knew I wanted to do more than just create and compare MCPs or KDEs to begin describing my research. Which brings me to you and your T_LoCoH software. I believe it is great y'all were able to create a software package that incorporates time into the analysis. > > I am new to this software, but am willing to do what it takes to become more familiarized with it and be able to incorporate it into my data analysis. I have read your dissertation, your Home Range Plus publication, and the overview of the T_LoCoH program, along with following through with the example sets. Now its time for me to start analyzing my data. > > We conducted 2 consecutive releases (2010 & 2011) for this restoration effort. I currently have data from 54 GPS collars, with data collection ranging from <1wk to >2yrs. Over the course of the study, we used 3 different types of collars (all of which have differing data formats). The 2010 released collars collected data in Lat/Long and were programmed to obtain a location every 3 hours. The 2011 released collars collected data in UTMs and were programmed to collect a location every 5 hours. If you are going to collect data in future, it would be good to have finer resolution, depending of course on the problems you want to address. But information on diurnal activity cycles would best be served by data at least 2-3 fixes per hour, and more if possible. At this time, all you can compare are averages across 24-25 hour periods. > > I would ultimately like to compare the movements and UDs by release year, sex, and time of year (ecological seasons). Again, to see how with diurnal cycle patterns may vary across seasons, finer sub-hourly data would be good. > I would also like to use the GPS data to see if there are any preferred habitats (e.g. slope, aspect, terrain ruggedness, etc.) for the previously mentioned comparisons. It would also be great to be able to delineate ?travel corridor(s)' from the GPS data (esp. the sheep that were documented crossing international borders). I would suggest that you begin with at T-LoCoH analysis with fixed k and large s, where k=6 (this would give you points that are 25 hours apart using your 5 hour data) and s is large enough to give you consecutive points in time. You can then look at area and elongation of hulls, as well as revisitation rates to hulls and correlate these revisitation rates with your habitat variables. > > How do I need to go about entering and analyzing all of my data? Is there a way to compute an ?s', and an 'a or k' value that can be used on all of the sheep, or will I have to determine individual values? Use a k=6 for sheep that are monitored every 5 hours and a k=9 for sheep monitored very three hours. Then you will get 24-25 hour use kernels if s is large enough. So just make s large enough to ensure all neighbors are consecutive in time. Then, if you want home ranges, take a small s so that points 6 months apart add a component that is about the same as the spatial extent of data (i.e. s*6 months = the greatest spatial distance apart). You can then try an s half the size or twice the size to see what you get. > If I am able to combine the data sets, how to I need to go about the different coordinate systems? How do I deal with differing data set sizes (e.g. 1 month compared to 2 years) or collars that had different acquisition rates? If you are comparing diurnal values at a particular time of the year, you can use all values for that time of the year, but you cannot compare home range constructions based on 1 month versus 6 month data etc. > > Any help you're able to give would be most appreciated. > > Thanks and have a good one, > > > Thomas > > > _______________________________________________ > Tlocoh-info mailing list > Tlocoh-info at lists.r-forge.r-project.org > http://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/tlocoh-info ___________________________________________________________ ___________________________________________________________ Professor Wayne M. Getz A. Starker Leopold Professor of Wildlife Ecology Department Environmental Science Policy & Management 130 Mulford Hall University of California at Berkeley CA 94720-3112, USA Campus Visitors: My office is in 5052 VLSB Fax: ( (1-510) 666-2352 Office: (1-510) 642-8745 Lab: (1-510) 643-1227 email: wgetz at berkeley.edu lab: http://www.CNR.Berkeley.EDU/~getz/ T-LoCoH: http://tlocoh.r-forge.r-project.org/ NOVA: http://www.novamodeler.com/ ___________________________________________________________ ___________________________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: From wgetz at berkeley.edu Wed May 28 01:50:29 2014 From: wgetz at berkeley.edu (Wayne Getz) Date: Tue, 27 May 2014 16:50:29 -0700 Subject: [tlocoh-info] Dealing with multiple datasets Digest, Vol 6, Issue 8 In-Reply-To: <58862834A696BF4CA83ABDD585FD1C130C672688@mailstoreEx2010.srsu.edu> References: , <58862834A696BF4CA83ABDD585FD1C130C672688@mailstoreEx2010.srsu.edu> Message-ID: Hi Thomas I would suggest that you start using a fixed k method. This is more intuitive and you know how many consecutive points you will get if you select s large enough to wash out spatial distances. Thus if you are interested in diurnal patterns and have a fix frequency of one point every hour, then choosing k=7, 13 or 25 will give you hulls that correspond to a quarter, half or full 24-hour day (provide s is large enough). The a (adaptive method) is most appropriate if you are trying to build utilization distributions and want to adaptively change the number points where densities are high (in the core) verses low (at the boundaries). These distributions are best constructed with s=0 or very close to 0. In this case, I would select a value for a using our guide but compare what I get to values of a that are x% bigger or smaller where x may be something like 30%. Good luck. Wayne > Anne, > > I appreciate the response and help. I am still confused on the methods of computing a 's' and 'a' value for all of my datasets. Do I need to merge the data into 1 CSV doc and separate them by a Freq column, or do I need to individually load the datasets and run one-by-one or at the same time? > > Also, I have read and practiced the tutorial, it was helpful, but still only looked at one animal's data set in that example. > > As far as the coordinate system, I believe I am going to have everything calculated in UTMs. I will also try and figure out the resampling protocol to work with all of my datasets. > > Thanks and have a good one, > > > Thomas > ________________________________________ > From: tlocoh-info-bounces at lists.r-forge.r-project.org [tlocoh-info-bounces at lists.r-forge.r-project.org] on behalf of Anna Schweiger [anna.schweiger at nationalpark.ch] > Sent: Tuesday, May 27, 2014 12:20 PM > To: tlocoh-info at lists.r-forge.r-project.org > Subject: Re: [tlocoh-info] Dealing with multiple datasets Digest, Vol 6, Issue 8 > > Hi Thomas, > > I was also recently thinking on how to deal with multiple > datasets/multiple individuals. > Thanks to Wayne?s and Andy?s responses I could get my head around it. > The short version (at least in my case) is: > Either use the same parameter values for all individuals or the same > technique (the same treshold) to select the paramter values. > You find the full responses here (see point 1): > http://lists.r-forge.r-project.org/pipermail/tlocoh-info/2014-May/000013.html > > For me a good way to get started with was to follow the Tutorial on > the TLoCoH homepage with my own data. > In the tutorial most initial issues are covered (coordinate systems, > data import). Have you already seen it? > http://tlocoh.r-forge.r-project.org/tlocoh_tutorial_2013-09-22.pdf > > Regarding coordinate system: I think you have to decide on one. Maybe > it?s best to use the coordinate system of your environmental data. If > you are working with raster data, it?s nice to avoid reprojecting > them. While reprojecting trajectories or points is quite straight > forward, raster reprojection involves two steps 1) project the cell > centers into the new CRS 2) resample the cell values into a regular > grid system. So, I always choose to reproject points, lines, polygons > and not raster. > > If you have differing sampling schemes, you can resample the data to a > common frequency (using xy.thin.byfreq). > For example: >> ibex.4h.lxy <- lxy.thin.byfreq (ibex.lxy, trim.ends=FALSE, samp.freq=14400, status=T) > # resamples my data on ibex, with sampling frequencies of 10 min, 2 h > and 4 h to a common interval of 4 h (14400 seconds) > > As far as I understood it, differing data set sizes (e.g. 1 month > compared to 2 years) are not problematic, because if you include time > in your analysis (s > 0), two points have to be close in time as well > as close in space to be considered as nearest neighbours. Of course, > if you are comparing individuals, the times (biological seasons) have > to be matched between individuals and you have to have enough > locations for nearest neighbours calculations (I chose to include only > indiv. with more than 90 fixes after resampling to a common > frequency). > > Hope it helps a bit. > Good luck with your analysis! > > Cheers, Anna > > > On Tue, 27 May 2014 12:00:11 +0200 > tlocoh-info-request at lists.r-forge.r-project.org wrote: >> Send Tlocoh-info mailing list submissions to >> tlocoh-info at lists.r-forge.r-project.org >> >> To subscribe or unsubscribe via the World Wide Web, visit >> http://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/tlocoh-info >> >> or, via email, send a message with subject or body 'help' to >> tlocoh-info-request at lists.r-forge.r-project.org >> >> You can reach the person managing the list at >> tlocoh-info-owner at lists.r-forge.r-project.org >> >> When replying, please edit your Subject line so it is more specific >> than "Re: Contents of Tlocoh-info digest..." >> >> >> Today's Topics: >> >> 1. Dealing w/ multiple datasets (Thomas Janke) >> >> >> ---------------------------------------------------------------------- >> >> Message: 1 >> Date: Mon, 26 May 2014 21:18:12 +0000 >> From: Thomas Janke >> To: "tlocoh-info at lists.r-forge.r-project.org" >> >> Subject: [tlocoh-info] Dealing w/ multiple datasets >> Message-ID: >> <58862834A696BF4CA83ABDD585FD1C130C672450 at mailstoreEx2010.srsu.edu> >> Content-Type: text/plain; charset="iso-8859-1" >> >> Andy, >> >> >> >> My name is Thomas Janke. I am a graduate student at Sul Ross State >> University in west Texas working for the Borderlands Research >> Institute. Over the past 3 years, I have been monitoring the >> movements and survival of reintroduced desert bighorn sheep to part >> of their historic range. Now comes time for the analysis and writing. >> >> >> >> After diving into past research and methodology, I knew I wanted to >> do more than just create and compare MCPs or KDEs to begin describing >> my research. Which brings me to you and your T_LoCoH software. I >> believe it is great y'all were able to create a software package that >> incorporates time into the analysis. >> >> >> >> I am new to this software, but am willing to do what it takes to >> become more familiarized with it and be able to incorporate it into >> my data analysis. I have read your dissertation, your Home Range Plus >> publication, and the overview of the T_LoCoH program, along with >> following through with the example sets. Now its time for me to start >> analyzing my data. >> >> >> >> We conducted 2 consecutive releases (2010 & 2011) for this >> restoration effort. I currently have data from 54 GPS collars, with >> data collection ranging from <1wk to >2yrs. Over the course of the >> study, we used 3 different types of collars (all of which have >> differing data formats). The 2010 released collars collected data in >> Lat/Long and were programmed to obtain a location every 3 hours. The >> 2011 released collars collected data in UTMs and were programmed to >> collect a location every 5 hours. >> >> >> >> I would ultimately like to compare the movements and UDs by release >> year, sex, and time of year (ecological seasons). I would also like >> to use the GPS data to see if there are any preferred habitats (e.g. >> slope, aspect, terrain ruggedness, etc.) for the previously mentioned >> comparisons. It would also be great to be able to delineate 'travel >> corridor(s)' from the GPS data (esp. the sheep that were documented >> crossing international borders). >> >> >> >> How do I need to go about entering and analyzing all of my data? Is >> there a way to compute an 's', and an 'a or k' value that can be used >> on all of the sheep, or will I have to determine individual values? >> If I am able to combine the data sets, how to I need to go about the >> different coordinate systems? How do I deal with differing data set >> sizes (e.g. 1 month compared to 2 years) or collars that had >> different acquisition rates? >> >> >> >> Any help you're able to give would be most appreciated. >> >> >> >> Thanks and have a good one, >> >> >> >> >> >> Thomas >> >> >> >> >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: >> >> >> ------------------------------ >> >> _______________________________________________ >> Tlocoh-info mailing list >> Tlocoh-info at lists.r-forge.r-project.org >> http://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/tlocoh-info >> >> >> End of Tlocoh-info Digest, Vol 6, Issue 8 >> ***************************************** > > _______________________________________________ > Tlocoh-info mailing list > Tlocoh-info at lists.r-forge.r-project.org > http://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/tlocoh-info > _______________________________________________ > Tlocoh-info mailing list > Tlocoh-info at lists.r-forge.r-project.org > http://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/tlocoh-info ___________________________________________________________ ___________________________________________________________ Professor Wayne M. Getz A. Starker Leopold Professor of Wildlife Ecology Department Environmental Science Policy & Management 130 Mulford Hall University of California at Berkeley CA 94720-3112, USA Campus Visitors: My office is in 5052 VLSB Fax: ( (1-510) 666-2352 Office: (1-510) 642-8745 Lab: (1-510) 643-1227 email: wgetz at berkeley.edu lab: http://www.CNR.Berkeley.EDU/~getz/ T-LoCoH: http://tlocoh.r-forge.r-project.org/ NOVA: http://www.novamodeler.com/ ___________________________________________________________ ___________________________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: