The second week of working on the Hedgehog project has been a bit slower than I’d hoped. One of my goals for this week was to build a foundational pipeline for the movement modeling. I sank quite a lot of hours into implementing a step selection function (SSF) model in R and the amt package with a few different geospatial layers. I then discovered integrated step selection analysis (iSSA), and obtained seemingly better results with that than with the SSFs. I then integrated these models into an agent-based model, as that should enable integration of known behavioral patterns (day/night cycles, foraging/traveling/resting etc.)

Continuing on last week, I also did some more work on the datasets.

Data

There really is a ton of data available pretty publicly from UK government-managed databases. Some of the most interesting ones are land uses maps, and in particular the specialized crops map. This map details with a really good resolution (and hopefully reliable accuracy) the crops grown across the entire country. There are also good, more general maps, which I think are particularly useful for identifying urban and suburban areas (which is, obviously, very important).

Another interesting official datasets are maps of pesticides and fertilizers. The pesticides dataset, for instance, documents use of 162 different types of pesticides. According to some preliminary research, number of those could be relevant for hedgehogs. Some pesticides reduce the abundance of hedgehogs prey (e.g. earthworms). Other (e.g. slug pellets) are deliberately ingested by hedgehogs, despite sometimes causing them health issues. Unfortunately, the version of the dataset I was able to obtain suffers from a pretty low resolution, and would, therefore, possibly be relevant for large-scale modeling, but not necessarily for our small region.

Furthermore, the hedgerows, stonewalls, and woodland dataset discussed last time is awesome, but unfortunately about 50% of our tiny region lies in an unrecorded patch of land, and I have, therefore, not been able to use it for the modelling. I reached out to the dataset’s creators, and am waiting to hear back. Similarly, using LIDAR to try and infer location of brambles has been rather disappointing, but I should speak with Andrès about it tomorrow, so that will probably be very helpful.

Modeling

I decided to pursue SSFs as the foundational modeling technique. SSFs evaluate movement as a sequence of steps—each defined by a movement from one location to another—by comparing actual observed steps, derived from GPS or telemetry data, to alternative steps the animal could plausibly have taken. These alternative steps are generated from the same starting point as the observed step, using a movement kernel that captures empirical distributions of step lengths and turning angles. Once both used and available steps are defined, a conditional logistic regression model is used to assess which environmental variables influence the animal’s choice of direction or destination. The resulting coefficients describe the strength and direction of selection for landscape features such as vegetation type, elevation, or proximity to roads. SSFs are particularly powerful because they integrate movement behavior with habitat selection, taking into account the animal’s previous location and thereby reflecting realistic constraints on movement.

iSSAs build directly upon SSFs. However, while SSFs focus on where animals choose to go, they generally reflect movement characteristics like step length and turning angle as secondary or incidental. iSSA addresses this by explicitly using movement-related covariates (e.g. step length, turning angle, and interactions between these and environmental variables) into the modeling process. This allows to simultaneously infer both movement and habitat selection processes, rather than treating them separately.

Nonetheless, these statistical models cannot capture more complicated patterns, but their outputs should be quite easily integrated into some overarching pipelines. One such extension should be ABMs, which provide the opportunity to leverage not only the statistical coefficients, but also other expectations regarding the hedgehogs behavior and interaction patterns.

I implemented the initial ABM model with mesa in Python, and have tried to keep everything very modular (that also applies to the SSFs/iSSAs), so I have space to make adjustments in the future. Nonetheless, I suspect the extent to which the model can be augmented (by, e.g., some kind of gaussian processes) is limited by several factors, primarily the scarcity of the tracking data.

To fit the models, I used the three complete datasets mentioned in the data section:

1) Roads network. 2) Crops. 3) Land use.

I would have also used the hedges & stonewalls & forestry layers, but as those were incomplete in the particular region of my interest, I did not. Nonetheless, it will be extremely easy to plug them in if I ever obtain them for this region. Furthermore, I also tried to model the hedgehogs by sexes (female and male), on top of both sexes together.

Across the board, using the akaike information criterion (AIC), iSSA outperformed SSF. For instance, here is a summary of the performances for both sexes at once:

Model AIC
SSF: Crops 14059.6
SSF: Land cover 85141.19
SSF: Combined 13888.36
iSSA: Combined 6499.432

Moreover, the coefficients found by iSSA were generally quite interesting, and even confirmed some of the expectations. For instance, that females avoid roads, favor short, less directional steps especially in certain crops/landcovers, while males are less road‐averse, show very strong selection for particular crops (maize, beans) and landcovers (grassland, suburban), and move more tortuously. To illustrate, here is a shortened summary of some of the coefficients:

Term Female coef. Male coef. Both coef.
roads -0.004978 0.000011 0.000030
maize 1.046 1.497 0.941
oilseed_rape 0.921 0.911
potatoes 31.130 2.911
other_crops -4.867 0.016
spring_field_beans 2.371 0.212
broadleaved_mixed_and_yew_woodland -12.390
improved_grassland 0.491 2.084 0.059
suburban -0.056 1.701 0.640