-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
executable file
·95 lines (61 loc) · 6 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
---
title: "Movement modelling in receiver networks"
author: Edward Lavender*
output: github_document
---
[![Project Status: Active -- The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
^\*^This repository is maintained by Edward Lavender (edward.lavender@eawag.ch).
# Introduction
This repository contains methods, written in [R](https://www.r-project.org/) and organised as an [RStudio](https://www.rstudio.com/) [Project](https://r4ds.had.co.nz/workflow-projects.html), 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`](https://github.com/edwardlavender/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;
# Description
## Dependencies
The project was built in [R](https://www.r-project.org/) (version `r paste0(version$major, ".", version$minor)`) in [RStudio](https://www.rstudio.com/) and implements local dependency management using [`renv`](https://rstudio.github.io/renv/articles/renv.html). This manages the installation of the [`dv`](https://github.com/edwardlavender/dv) package (from [GitHub](https://github.com/)), as well as other packages from the [Comprehensive R Archive Network](https://cran.r-project.org/). The first time the project is opened, [`renv`](https://rstudio.github.io/renv/articles/renv.html) can be used to regenerate the local project library, as described in `renv.lock` (via `.Rprofile` and `renv/activate.R`).
## Directories
The project follows a standardised structure encouraged by the [`dv`](https://github.com/edwardlavender/dv) package. The high-level structure was generated via `dv::use_template_proj()`. The contents as follows:
1. **`renv/`** implements local dependency management.
2. **`data/`** contains data files:
- `sims/` contains simulation inputs and outputs:
- `input/` contains simulation inputs;
- `output/` contains simulation outputs;
- `inst/` contains [RStudio](https://www.rstudio.com/) [Project](https://r4ds.had.co.nz/workflow-projects.html)-management files generated by [`dv`](https://github.com/edwardlavender/dv):
- `dependencies.rds` is a list of dependencies;
- `session-info.rds` is a record of information about the [R](https://www.r-project.org/) Session;
- `tree.rds` is a record of the project directory tree (as generated by `dv::use_template_tree()` in `dev/02-dev.R`, see below); <br/>
3. **`R/`** contains scripts for data processing and analysis:
- `sim-data.R` simulates 'observations';
- `plot-data.R` plots observation models and simulated datasets;
- `process-data.R` processes data for algorithm implementations;
- `process-data-rsp.R` processes data for RSP implementations;
- `run-performance-path.R` estimates utilisation distributions (UDs) for simulated paths;
- `run-performance-coa.R` estimates UDs from COAs;
- `run-performance-rsp.R` estimates UDs from RSPs;
- `run-patter.R` estimates UDs using particle algorithms;
- `calculate-skill.R` calculates skill metrics for selected algorithms;
- `analyse-performance.R` compares algorithm performance;
- `analyse-sensitivity.R` analyses algorithm sensitivity to parameter mis-specification; <br/>
4. **`src/`** contains helper (`R`) functions.
5. **`Julia/`** contains a `Julia` project.
- This is set up by [`patter`](https://github.com/edwardlavender/patter);
6. **`dev/`** contains project-management scripts.
- `01-dev.R` and `02-clone.R` are standard [`dv`](https://github.com/edwardlavender/dv) scripts:
- `01-dev.R` records project set up and development;
- `02-clone.R` is used to clone the project (see 'Instructions');
7. **`fig/`** contains figures.
8. **`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.
# Instructions
Follow the steps described below to clone the project and reproduce the workflow.
1. **Clone the project** via GitHub. Follow the instructions in `dev/02-clone.R` to install packages and directories:
- **Packages.** Work through `dev/02-clone.R` to use [`renv`](https://rstudio.github.io/renv/articles/renv.html) to 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.
2. **Run the scripts** in order to simulate data, implement the algorithms and analyse results.
# Citation
Lavender, E. et al. (in prep). Particle algorithms for animal movement modelling in autonomous receiver networks.
# Code of conduct
Please note that this project is released with a [Contributor Code of Conduct](https://contributor-covenant.org/version/2/1/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms.
------------------------------------------------------------------------