Edward Lavender*
*This repository is maintained by Edward Lavender (edward.lavender@eawag.ch).
This repository contains methods, written in
R and organised as an
RStudio
Project, for the
evaluation of methods designed to reconstruct movements and/or patterns
of space use of tagged animals in passive acoustic telemetry systems.
This code supports Lavender, E. et al. (in prep). Using simulated data,
we compared the performance of the prevailing heuristic methods (i.e.,
centres of activity [COAs] and refined shortest paths [RSPs])
alongside our new particle-based methods, implemented by the
patter package, for
reconstructing patterns of space use. We found that particle-based
methods outperform heuristic approaches across the board and represent a
new state-of-the-art for movement modelling in passive acoustic
telemetry systems.
Key elements of the workflow include:
- Simulation of arrays, movement paths and observations (e.g. detections);
- Implementation of approaches for the reconstruction of patterns of space use;
- Analyses of method performance under different conditions;
- Analyses of method sensitivity under different conditions;
The project was built in R (version 4.3.1)
in RStudio and implements local dependency
management using
renv. This
manages the installation of the
dv package (from
GitHub), as well as other packages from the
Comprehensive R Archive Network. The
first time the project is opened,
renv can be used
to regenerate the local project library, as described in renv.lock
(via .Rprofile and renv/activate.R).
The project follows a standardised structure encouraged by the
dv package. The high-level
structure was generated via dv::use_template_proj(). The contents as
follows:
-
renv/implements local dependency management. -
data/contains data files:sims/contains simulation inputs and outputs:input/contains simulation inputs;output/contains simulation outputs;inst/contains RStudio Project-management files generated bydv:dependencies.rdsis a list of dependencies;session-info.rdsis a record of information about the R Session;tree.rdsis a record of the project directory tree (as generated bydv::use_template_tree()indev/02-dev.R, see below);
-
R/contains scripts for data processing and analysis:sim-data.Rsimulates ‘observations’;plot-data.Rplots observation models and simulated datasets;process-data.Rprocesses data for algorithm implementations;process-data-rsp.Rprocesses data for RSP implementations;run-performance-path.Restimates utilisation distributions (UDs) for simulated paths;run-performance-coa.Restimates UDs from COAs;run-performance-rsp.Restimates UDs from RSPs;run-patter.Restimates UDs using particle algorithms;calculate-skill.Rcalculates skill metrics for selected algorithms;analyse-performance.Rcompares algorithm performance;analyse-sensitivity.Ranalyses algorithm sensitivity to parameter mis-specification;
-
src/contains helper (R) functions. -
Julia/contains aJuliaproject.- This is set up by
patter;
- This is set up by
-
dev/contains project-management scripts.01-dev.Rand02-clone.Rare standarddvscripts:01-dev.Rrecords project set up and development;02-clone.Ris used to clone the project (see ‘Instructions’);
-
fig/contains figures. -
doc/contains supporting documents.
Note that the data/ (except data/inst/), fig/ and doc/
directories are not provided in the online version of this repository.
However, all algorithm inputs/outputs can be reproduced by implementing
the code, as described below.
Follow the steps described below to clone the project and reproduce the workflow.
-
Clone the project via GitHub. Follow the instructions in
dev/02-clone.Rto install packages and directories:- Packages. Work through
dev/02-clone.Rto userenvto regenerate the local project library. Contact us for support with the installation of custom packages, if required. - Directories. Rebuild the project directory tree, via
dv::use_template_tree(). This re-creates the folders required to store outputs.
- Packages. Work through
-
Run the scripts in order to simulate data, implement the algorithms and analyse results.
Lavender, E. et al. (2025). Particle algorithms for animal movement modelling in receiver arrays. Methods in Ecology and Evolution, 00, 1–12. https://doi.org/10.1111/2041-210X.70028
Please note that this project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.