Movement ecology in R
A GPS track is not a record of where an animal went. It is a record of where a tag reported being, at moments the tag chose, with an error that has its own distribution. Everything on this page is an attempt to get from that to a statement about the animal, and every method here differs mainly in which part of the gap it takes seriously.
This page collects every movement tutorial on this site. All of them build the likelihood or the filter by hand in base R, so the assumption doing the work is on the page rather than inside a package.
The scale problem, which comes before the models
Step length and turning angle are not properties of the animal. They are properties of the animal and the fix interval together. Sample the same walk every minute and every hour and you get two different distributions, two different path lengths and two different tortuosities, and neither of them is the true one. This is not a nuisance to be corrected: it means the sampling schedule is part of the model, and it is why the same track can support two contradictory descriptions without either analysis being wrong.
The same logic runs through the rest. A home range is not a fact about the animal either. A minimum convex polygon grows with the number of fixes, and a kernel estimate answers whatever the bandwidth tells it to answer.
Two questions that look like one
Where does the animal go, and what is it doing? The first is space use: an outline, a utilisation surface, a selection ratio between what was used and what was available. The second is behaviour: the same track read as a sequence of hidden states, encamped or transiting, each with its own step and turn distributions.
The hidden Markov model is the standard answer to the second question, and it is honest about something the first question hides: a state is a statistical construct, not an observed behaviour. Add a state and the model will find one. The number of states is a decision, and the label attached to a state is a hypothesis you brought with you.
Observation error is not noise you can smooth away
A Kalman filter separates the path the animal took from the error the tag made, and it does so by assuming a movement model. Change the movement model and the smoothed path changes, which is a fair price as long as it is stated. Two cases break the standard version: irregular or gappy sampling, which wants a continuous-time process rather than a discrete one, and heavy-tailed location error, where a Gaussian filter is dragged off course by outliers that a particle filter simply absorbs.
Selection: available is a choice, not a fact
A resource selection function compares used locations with available ones, and the word “available” is doing enormous work: you decide what the animal could have reached, and your decision sets the answer. Step selection tightens this by asking the question one step at a time, from where the animal actually was, which is a better definition of available. It also produces the recurring honest limit of this whole family: a fitted selection value is relative. It ranks habitats. It is not a probability of use, and nothing in the fit turns it into one.
The tutorials
Space use: where an animal ranges
- Home range with MCP and KDE - polygons and kernels, and why the bandwidth decides the answer.
- Resource selection functions - used against available, and why the fitted value ranks rather than predicts.
The path itself
- Step lengths and turning angles - describing a path, and why the fix interval is part of the description.
- Correlated random walks - the diffusion null, and telling ranging from a bounded range or a migration.
Observation error: state-space models
- State-space models for movement - a hand-coded Kalman filter and smoother splitting path from error.
- Regularising irregular tracks - continuous time for gappy data, with honest uncertainty in the gaps.
- A particle filter for movement - when the location error has heavy tails and the Kalman filter follows the outliers.
- Bayesian state-space movement - the latent path sampled rather than filtered, and the process-versus-observation trade-off.
- Checking a state-space model - one-step innovations, and why residual autocorrelation is the main diagnostic.
Choice, step by step
- Step selection functions - matched used and available steps, with the conditional likelihood by hand.
- Integrated step selection analysis - de-biasing selection by modelling the movement kernel at the same time.
- Availability sampling - how many control steps, and what that count does and does not buy.
- Validating a step selection model - simulating from the fit and asking whether it reproduces the habitat that was chosen.
Where this connects
- Spatial capture-recapture and SCR sampling design model where an animal lives from detections rather than from a tag.
- Activity patterns and temporal overlap treats time of day as the circular variable a movement HMM uses as a covariate.
- Ripley’s K asks the clustering question of static point locations.
- Kaplan-Meier survival curves is where telemetry goes when the event of interest is death rather than a step.
- Capture-recapture in R is the other half of what a marked individual can tell you.