Session 7 — Resource selection and step selection functions
University of Rome Tor Vergata
2026-10-06
Internal state Motion capacity Navigation capacity External factors Movement path
Where does an animal go, given what is available to it — and how does the environment change the way it moves? Today separates those two questions and then fits them together.
An animal selects a resource when it uses it disproportionately to its availability.
The second sample is not data. You construct it, and the construction encodes a hypothesis. Most disagreements about habitat selection results are disagreements about availability.
Green: forest. Almost every fix is in forest — but so is almost everything available. The signal is in the comparison: outside forest, Lupe turns up 5 times less often than availability predicts.
| Order | Question | Available = |
|---|---|---|
| 1st | Where is the species’ range? | The planet |
| 2nd | Where does this individual put its home range? | The study area / population range |
| 3rd | Where within its home range does it go? | The home range |
| 4th | Which items does it take at a site? | Items at the site |
The same animal can show opposite results at different orders. A deer may place its home range in forest (2nd order) yet prefer clearings within it (3rd order). Always state your order — it is the definition of “available”.
Two studies of the same wolf population reach opposite conclusions about selection for roads. Study A used available points drawn from the whole national park; study B drew them from within each wolf’s home range. Who is right?
Study A asks a second-order question: given the whole park, do wolves put their home ranges in areas with more or fewer roads? Study B asks a third-order question: within the home range a wolf has already chosen, does it approach or avoid roads?
These routinely give opposite answers, and the pattern is common and interpretable: wolves may settle in road-poor parts of the park (avoidance at 2nd order) while using road verges and tracks as travel routes once there (selection at 3rd order).
Neither study is wrong. Both are incomplete if they do not state the order and the availability domain — which is why that belongs in the abstract, not buried in the methods.
| Design | Compares | Estimates | Model |
|---|---|---|---|
| Used–available (RSF) | fixes vs random points in a domain | relative selection | logistic, weighted |
| Used–unused (RSPF) | sites used vs sites known to be unused | absolute probability of use | logistic |
| Matched steps (SSF) | each step vs steps available from the same point | relative selection, conditional on movement | conditional logistic |
Absolute probabilities need genuine absences — sites surveyed and known to be unused (Lele & Keim 2006 discuss when an RSPF is estimable). Telemetry almost never provides them, which is why almost every tracking study fits an RSF or an SSF and reports relative selection.
The same fisher (red). Each panel zooms into the dashed box of the previous one: the study area, the home range, and eight steps with their control steps (grey).
\[w(\mathbf{x}) = \exp(\beta_1 x_1 + \beta_2 x_2 + \cdots + \beta_k x_k)\]
\(w(\mathbf{x})\) is the relative probability of use, proportional to the true probability by an unknown constant.
Your RSF gives \(\hat\beta = 0.69\) for a standardised NDVI covariate. What can you correctly say?
RSF coefficients are on the log scale, so the effect is multiplicative: \(e^{0.69} \approx 2\). A one-standard-deviation increase in NDVI doubles the relative probability of use, holding the other covariates fixed.
“Relative” is doing essential work in that sentence. The RSF is proportional to the probability of use by an unknown constant — the intercept depends entirely on how many available points you happened to draw — so absolute probabilities are not available to you.
Standardising covariates before fitting is what makes “one SD” meaningful and lets you compare effect sizes across covariates measured in different units.
Changing the availability domain can reverse the sign of a coefficient. This is not a flaw in the method — it is the method working. Different domains ask different questions.
Lupe’s forest coefficient and 95% CI, refitted with more and more available points. The estimate settles by about ten per fix; the interval hardly narrows, because the information is in the 774 used fixes.
A step selection function fixes this by defining availability from the animal’s own movement capacity: from where it was, where could it plausibly have gone?
For each observed step:
Because the comparison is within a stratum, everything constant at that moment — time of day, season, the animal’s internal state, its identity — cancels out. That is a remarkably clean piece of control.
Square: where the fisher was. Dotted: the steps that brought it there. The model asks only how the used step differs from its own controls.
\[ P(\text{step } j \text{ chosen}) = \frac{\exp(\boldsymbol{\beta}^{\top}\mathbf{x}_j)} {\sum_{i \in \text{stratum}} \exp(\boldsymbol{\beta}^{\top}\mathbf{x}_i)} \]
survival::clogit() and amt::fit_issf() both go through coxph()The paper that made SSFs standard: elk in Yellowstone after wolves returned.
The SSF made it possible to ask how predators change fine-scale movement decisions, not just where prey live.
Why does a step selection function include strata(step_id_)?
The stratum is the design. Each observed step is matched to the controls generated from the same location at the same moment, and the likelihood only ever compares within that matched set.
This is what makes availability local and time-specific — and it means anything constant within the stratum (hour of day, season, weather, the animal’s identity and internal state) is automatically controlled for, without you having to model it.
Individual-level repeated measures are a separate issue, handled by fitting per animal or by a mixed conditional model (Muff et al. 2020). Dropping strata() does not merely change the standard errors — it fits an entirely different, and wrong, model.
To generate control steps you need the animal’s step-length and turning-angle distributions. But those distributions are themselves affected by habitat — an animal moves slowly in good habitat and fast through bad.
Integrated step selection analysis (Avgar et al. 2016) solves this by estimating the movement kernel and the selection coefficients simultaneously, from the same model.
Include the movement variables as covariates in the conditional model:
sl_ and log(sl_) — together these correct the gamma step-length distribution used to generate the controlscos(ta_) — corrects the von Mises turning-angle concentrationIf controls were drawn from a gamma with shape \(k\) and scale \(\theta\):
| Term | Effect on the realised kernel |
|---|---|
| \(\beta_{\log(sl)}\) | adjusts shape: \(k_{\text{real}} = k + \beta_{\log(sl)}\) |
| \(\beta_{sl}\) | adjusts scale: \(1/\theta_{\text{real}} = 1/\theta - \beta_{sl}\) |
| \(\beta_{\cos(ta)}\) | adjusts concentration: \(\kappa_{\text{real}} = \kappa + \beta_{\cos(ta)}\) |
A positive \(\beta_{\cos(ta)}\) means the animal moves more directionally than your tentative distribution assumed. amt::update_gamma() and update_vonmises() do this arithmetic for you — use them rather than doing it by hand.
Grey: the distributions Lupe’s control steps were drawn from. Red: the movement kernel after the iSSA correction. For this fisher the correction is small (mean step 147 → 154 m); it is large when habitat strongly shapes how far an animal moves.
The real power is asking whether movement depends on habitat:
_start covariates modify the movement kernel — how the animal moves from that habitat_end covariates capture selection — which habitat it moves intoIn an iSSA you find a positive coefficient on sl_:forest_start. What does it mean?
An interaction with sl_ modifies the movement kernel, not the selection term, and _start means the covariate is measured at the step’s origin. So this says: given that the animal is in forest, its steps are longer.
Ecologically that usually means the animal is transiting, not using, the forest — it crosses quickly rather than lingering.
Note how this can coexist with positive selection for forest (forest_end > 0): an animal may head into forest and then move through it rapidly. Separating “where does it go” from “how does it move once there” is exactly what iSSA buys you, and it is invisible to an RSF.
An iSSA gives you two things at once:
Multiply them and you have the animal’s redistribution kernel: the probability of being at each place one step from now. Iterate it, and you simulate new tracks — in the current landscape, or in one you are planning to change.
That is the bridge to mechanistic models: a fitted iSSA is a generative model of movement, like the random walks of Session 5, but with the environment built in.
The simulated animal of today’s practical (β = 1.5) in a 1.8 km window. Square: where it is; arrow: its last step. Movement says how far and which way; selection tilts the kernel towards better habitat.
The natural effect size for an SSF (Avgar et al. 2017; Fieberg et al. 2021):
\[\text{RSS}(x_1, x_2) = \exp\big(\beta\,(x_1 - x_2)\big)\]
amt warns and replaces themglmmTMB with random slopes and a fixed large variance on the stratum interceptsYou fit an iSSA with 10 control steps per stratum, then refit with 100. The coefficients barely move but all the standard errors halve. What do you report?
Stable coefficients are exactly what you want to see — it means 10 controls already characterised availability well, and that is the check worth reporting.
The shrinking standard errors are the same trap as with RSF availability. Control steps describe what was available, which you can sample as finely as you like. More of them sharpen your description of availability; they do not constitute additional observations of the animal’s choices. Your real sample size is the number of steps — and, for population inference, the number of animals.
Report the effect sizes, state how many controls you used, and show that the estimates were stable with respect to that choice.
| RSF | SSF / iSSA | |
|---|---|---|
| Availability | Whole domain, fixed | Local, moves with the animal |
| Order | Usually 2nd or 3rd | Effectively 3rd, step-scale |
| Needs regular sampling | No | Yes |
| Models movement | No | Yes |
| Time-varying covariates | Awkward | Natural |
| Best for | Broad-scale range placement | Fine-scale decisions, corridors, barriers |
If your data are regularly sampled and you care about how the animal moves through the landscape, use iSSA. If your sampling is sparse or irregular, and your question is about broad-scale range placement, an RSF is the honest choice.
extract_covariates(), fit_issf()_start covariatesstrata(step_id_) is the design, not a detail_end covariates select, _start covariates modify movementlibrary(momentuHMM) loads, and prepare a 3–5 minute mini-project pitch