GEOG 566

         Advanced spatial statistics and GIScience

April 30, 2018

Path Analysis for Understanding Visitor Movement

Filed under: 2018,Exercise/Tutorial 1 2018 @ 11:45 am

Question Asked

The movement ecology paradigm provides a useful, organizing framework for understanding and conducting path analysis on GPS tracks of overnight, wilderness sea kayakers in Glacier Bay National Park and Preserve Wilderness. Formally proposed in 2008, the movement ecology paradigm was designed to provide an overarching framework to guide research related to the study of organismal movement, with specific emphasis on guiding questions of why organisms move and how movement occurs through the lens of space and time (Nathan et al., 2008). The framework emphasizes understanding components of the movement, looking for patterns among those components, and understanding meaning behind movement through the underlying patterns (Figure 1). Ultimately, the target understanding is the movement path itself, which can be understood through quantification of the external factors, internal factors, and capacity for movement and/or navigation by the moving organism (Figure 2; Nathan et al., 2008). Through employing a movement ecology approach to the study of overnight kayaker movements in a protected area, individual movement tracks can be broken down into relevant components, the components of the path can be studied for patterns, and ultimately internal and external factors can be explored for influence or explanation of the movement path.

Following the movement ecology paradigm, the questions of focus for Exercise 1 include the following:

  1. How does the distribution of step lengths and turning angles vary throughout the duration of the overnight kayaker’s trip?
  2. What is the frequency of step lengths (in meters) at one-minute time intervals for overnight kayaker movements?
  3. What is the frequency of turning angles (in degrees) at one-minute time intervals for overnight kayaker movements?

These questions focus on understanding two parameters of interest for individual movement paths: step length and turning angle. These parameters have traditionally been used to describe and quantify the movement of animals. Changes in step length and/or turning angle have been used to identify changes in behavioral states among animals, such as migration or foraging behaviors. In the context of this work, I hypothesize that understanding changes in step length and turning angle among kayakers will allow us to identify changes in the behavioral states of the recreationists of focus in this work. Therefore, univariate analyses to create histograms of step length and turning angle were produced for a small test batch of five GPS tracks.

Tool/Approach Used

Jenna and I worked together on developing the analytical approach – both from a conceptual perspective and from a pratical and mechanical perspective in R. We used the R analysis package moveHMM to generate step lengths and turning angles for each minute of the track (Michelot, Langrock, & Patterson, 2017). The packages uses hidden Markov models and the frequentist (drawing conclusions from sampled data emphasizing frequencies and/or proportions) statistical approach. The hidden Markov model approach requires that spatial data meet the following two criteria: 1) the data are sampled at regular intervals, and 2) the spatial data have a high degree of accuracy with minimal positional error. The data used in this exercise are believed to meet the criteria for hidden Markov models. First, while the data were not originally collected in one-minute increments, the maximum amount of time between collection of X,Y coordinates throughout a track was one-minute. The data were down-sampled into one-minute time bins to standardize the sampling interval through averaging the values of the X and Y coordinates for each one-minute interval. The maximum number of X,Y points averaged per one-minute was 6, as the minimum amount of time between X,Y observations was 8 seconds. Second, the spatial accuracy of the GPS units used to collect the tracks advertise a spatial accuracy of 2.5 meters. Given that the emphasis of the overall analysis is to understand general patterns in movement and behavioral relative to time rather than in relation to specific X,Y point locations the potential for up to 2.5 meters of spatial inaccuracy in the data does not present a cause for concern. Additionally, the data were visually inspected using ArcMap and significant spatial inaccuracies were removed prior to analysis. The tracks analyzed are believed to be free from spatial inaccuracy due to unit malfunction or loss of satellite signal.

Additional tools used for data preparation and data visualization for use before and after the moveHMM package tool include the following:

  1. A function to convert latitude and longitude spatial measures to UTM measures (source code taken from
  2. The plotSat function in the R package ggmap.

Description of Steps Used to Complete the Analysis

Jenna and I developed R scripts to complete the data transformation and formatting needed for data output from the collected GPS units to be ready for analysis by the moveHMM R package, run the tool, and create additional data visualizations.

Data Input: The input data was the attribute table of all the collected GPS tracks exported as a CSV file from ArcMap.

Steps for Analysis:

Data preparation for moveHMM: The tool requires that data be regularly sampled and that each observation has a unique numeric ID code associated with the data in the data frame. The tool will operate on latitude and longitude coordinates, but for this application of the tool it was decided that UTM coordinates, with units of meters, produced results that were practically meaningful.

  1. Import CSV file into R Studio (manually). Make sure the data column with the date and time of X,Y point collection is set to datetime.
  2. Down sample the data so that X,Y observations are aggregated into one-minute time bins. Average X and Y coordinates within each minute to produce one-minute time bin summary.
  3. Convert the averaged latitude and longitude coordinates to UTM coordinates.
  4. Insert a new ID data column to provide a numeric ID code for each GPS track in the data frame.

Running the moveHMM tool and generating output:

  1. Run the moveHMM tool and create plots. See lines of code below for example commands:

#Loading prepared dataframe into moveHMM for creation of step length and turning angle histograms

data <- prepData(PreppedData_MoveHMM, type = “UTM”, coordNames = c(“X”, “Y”))


#Creating plots of and histograms


The output of the moveHMM tool is a series of four figures produced for each GPS track (Figure 3). The top left histogram depicts how the step length (meters) varies through time (t = minutes). The top right histogram depicts how the turning angle (radians) varies through time (t = minutes). The bottom two histograms show the frequencies of step length and turning angle. The moveHMM summaries leave something to be desired, namely, the frequency histograms are not expressed as a percentage on the Y axis and the histograms are not standard across all tracks analyzed – the lengths of the X and Y axes vary. To produce more descriptive figures, the output file produced from the moveHMM analysis was manipulated to produce additional histograms for step length and turning angle.

Data Visualization of moveHMM results:

Step Length

  1. Identify the minimum and maximum step length values from the entire dataset. Given the minimum and maximum step length values, determine the desired number of step length bins for the X axis.
  2. Summarize the step lengths into the desired bins. Calculate the percentage of step lengths per bin.
  3. Create bar charts of individual tracks and all tracks together using ggplot.

Turning Angle

  1. Display the calculated turning angels in a rose diagram using the rose.diag tool from the R package Circular using 12 bins.

Description of Results Obtained

The step length and turning angle histograms suggest that across the five test tracks processed using the moveHMM tool, the majority of step lengths across the tracks were between 600-700 meters per minute and kayakers generally traveled in a straight direction turning infrequently. The step lengths were greater than originally anticipated, but after investigation into average speeds of travel for water-based recreationists, it appears that having a step length of 600-700 meters per minute is not unreasonable. Outside of the 600-700 meter per minute step length bin, the 0-100 meter per minute step length bin was the next most frequent among the step length bins. The 0-100 meter per minute step length bin likely represents stoppage time. The disparity between the two step length categories suggests that in the case of water-based recreationists, step length may be a good metric for examining changes in behavioral state in future bivariate analyses.

When looking at the available geography for water travel and the paths taken by the overnight kayakers, the small range of values observed for turning angle movements is consistent with the data visualization in space on the satellite image. Presently, the scale as which the turning angle histograms are presented is difficult to interpret and perhaps not refined enough to identify cut points in turning angle movements that would suggest changes in behavioral state. Further analysis and exploration is needed to understand whether or not turning angle would be a useful metric for further consideration in Exercise 2 analyses.

Critique of Method

Using the moveHMM tool to produce measures of step length and turning angle per minute of a recreationist’s trip provided a novel application for looking at changes in movement path overtime. Once the data were formatted properly, the tool was easy to run, producing a dataset with the calculated step length and movement angle measures while also producing four figure displays per track analyzed.

The data formatting for the tool and post processing visualization generated by the tool were cumbersome and had a steep learning curve. The tool requires data to be summarized into regular time bins for analysis. My data were not originally in this format; therefore, down-sampling was preformed to meet this requirement of the tool. Because the down-sampling was performed, in part, on a datetime variable in R, I experienced a learning curve in getting R to accurately read the date and time information in my data frame as a datetime class rather than a character or string class. Additionally, my data were not originally projected into UTM coordinates and I could not generate the necessary UTM coordinates through analysis in ArcGIS. I therefore had to search around for a work around and ended up finding a function that I was able to customize for use in transforming my data. While the moveHMM tool will work with latitude and longitude coordinates, the output is less meaningful and difficult to interpret when considering the variable of step length. Therefore, converting to UTMs was another data transformation step that was needed in order to run moveHMM smoothly.

The histograms generated by moveHMM, while useful in looking at overall patterns and trends are not user-friendly. The histograms themselves cannot be customized from within the package; therefore, any customization or additional data visualization must be done outside of the moveHMM package using different R tools. I would have also appreciated more documentation on the turning angle calculation, movements, and output. The associated tool documentation does not provide any guidance for interpreting the histograms, and while the step length histogram was pretty straight forward I had more difficulty with the turning angle diagram. This may be due to my inexperience with this measure, but I do feel the tool’s documentation could have provided more concrete examples of interpretation and additional documentation on units.



Michelot, T., Langrock, R., Patterson, T. (2017). An R package for the analysis of animal movement data. Available:

Nathan, R., Getz, W. M., Revilla, E., Holyoak, M., Kadmon, R., Saltz, D., & Smouse, P. E. (2008). A movement ecology paradigm for unifying organismal movement research. PNAS 105(49): 19052 – 19059.

Print Friendly, PDF & Email

No Comments

No comments yet.

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

© 2019 GEOG 566   Powered by WordPress MU    Hosted by