<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi Ambika,<br>
<br>
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 <u><br>
<br>
<br>
Data Prep</u><u><br>
</u><br>
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:<br>
<br>
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. <br>
<br>
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.<br>
<br>
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 <a
href="http://www.andylyons.org/files/lyons_2012_multi-optic-conservation_2012-12-14.pdf">my
dissertation</a> were created with this function and describe it a
little further.<br>
<br>
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).<br>
<br>
<u>Creating Hulls</u><u><br>
</u><br>
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. <br>
<br>
<u>Merging Hullsets</u><u> (if needed)<br>
</u><br>
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)<br>
<br>
<u>Creating metrics for temporally overlapping hulls</u><u><br>
</u><br>
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 <tt>maxdt</tt> 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 <tt>maxdt </tt>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 <tt>id</tt> and <tt>hs2.id </tt>arguments. <br>
<br>
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. <br>
<br>
<u>Creating Metrics for Spatially Overlapping Hulls</u><u><br>
</u><br>
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.<br>
<br>
<br>
<br>
<br>
On 5/13/2014 10:22 AM, Ambika Kamath wrote:<br>
<blockquote
cite="mid:CAL4BjaY1a6f+enA6caa1=D+TvL07_hspEwscq4Xs_MeR0Ob8NQ@mail.gmail.com"
type="cite">
<div dir="ltr">Hi Andy,
<div><br>
</div>
<div>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!</div>
<div><br>
</div>
<div>Many thanks again,<br>
</div>
<div>Ambika</div>
</div>
<br>
</blockquote>
<br>
</body>
</html>