This repository contains all code to process and analyse data as presented in Hewitt et al., (2023). Data for this project is hosted on the Integrated Marine Observing System Animal Tracking Facility (IMOS ATF) database under the NSW Department of Primary Industries Coastal and Estuarine Fish Tracking (CEFT) project.
Some analysis for this project was carried out using the High Performance Cluster (HPC) Katana hosted by UNSW ResTech, while some was performed on my personal laptop. The scripts are integrated, as in output from one flows into the next. However, this makes for a somewhat complicated workflow whereby computationally intensive parts were submitted to Katana and less intensive aspects were done locally. With this in mind, the following briefly describes the workflow and output from each step.
- Submit
crawl.pbs
to Katana which runscrawl.R
to estimate temporally-regular locations. - Locally process data using
environmental.R
this adds environmental data. - Submit
mixed-hmm.pbs
to Katana which runsmixed-hmm.R
. This fits all the mixed hidden Markov models with K = {1, ..., 4}. - Locally run
compare-mixtures.R
which compares the mixed models via AIC. - Submit
hmm.pbs
to Katana which runshmm.R
. This script fits hidden Markov models with covariates on the transition probability matrices using the random-effects structure selected during Step 4. - Locally run
results.R
. This is the final stage of the analysis and it starts by selecting among covariates and is then mostly plotting and producing summaries of the selected model.