DOI: 10.5061/dryad.xpnvx0kn2
title: Forecasting wildlife movement with spatial capture-recapture

description: Wildlife movement is an important process affecting species population
 biology and community interactions in myriad ways. Studies of wildlife
 movement have focused on retrospectively estimating movements of small
 numbers of individuals by outfitting them with GPS and telemetry tags.
 Recent developments in spatial capture-recapture modeling permit the
 integration of movement models that can estimate the movement of untagged
 and undetected individuals. Additionally, hidden Markov movement models
 provide a framework for forecasting individuals’ movements, which may be
 valuable in the conservation of threatened species facing risks that vary
 across space and time. We describe maximum likelihood estimators for
 spatial capture–recapture models integrated with simple, biased, and
 correlated random walk movement models formulated as hidden Markov models.
 Additionally, we demonstrate how to forecast wildlife movement based on
 these models and hidden Markov model algorithms. We conducted a simulation
 study to test the performance of the models’ abundance estimators and
 movement forecasts when fit to data simulated under different movement
 models. We also fit the models to spatial capture–recapture data collected
 on North Atlantic right whales off the Atlantic Coast of the southeastern
 United States. Random walk movement models improved abundance estimation
 and movement forecasts in our simulation study and received greater
 support from the data in the right whale case study than did activity
 center movement models. Forecasts of wildlife movement made under
 integrated spatial capture–recapture movement models will be most valuable
 when individuals have been observed recently, when sampling for
 individuals is extensive and efficient, and when the scale of individuals’
 movements is small relative to the scale of the study area and sampling
 process. 
description: # Forecasting Wildlife Movement with Spatial Capture-Recapture
 [https://doi.org/10.5061/dryad.xpnvx0kn2](https://doi.org/10.5061/dryad.xpnvx0kn2) The file Right\_Whale\_SCR\_Data.RData contains the data used for the analysis of right whale movements and density. ## Description of the data and file structure Data contained in Right\_Whale\_SCR\_Data.RData are formatted in a list, named "data", and are loaded into R and analyzed by the Right\_whale\_scr\_models.R script. The list data includes the following objects. y: The right whale encounter history. A matrix with the element in row *i*, column *j* equal to 1 if individual *i* was detected on sampling occasion *j* and 0 otherwise. detDists: A matrix of detection distances. If individual *i* was detected on occasion *j*, row *i*, column *j* holds the distance between where it was detected and the closest line transect survey effort. y.pix: A matrix of sub-regions/pixels in which individuals were detected. If individual *i* was detected on occasion *j*, row *i*, column *j* holds the sub-region in which it was detected. The sub-region corresponds to the row/Cell ID in the habitat object. y.g0.covar, y.ds.covar, y.hs.covar, y.hb.covar: Arrays of detection covariate data for the g0 parameter, the detection scale (sigma\_d) parameter of a half normal detection function, and the detection scale parameters of a hazard detection function, respectively. If individual *i* was detected on occasion *j*, row *i*, column *j* is 1 if the individual was detected by a Twin Otter aircraft and 0 if the individual was detected from a Cessna Skymaster aircraft. These data were not used in the analysis. g0.eh.covar.names, ds.eh.covar.names, hs.eh.covar.names, hb.eh.covar.names: The names of the covariates y.g0.covar, y.ds.covar, y.hs.covar, and y.hb.covar, respectively. These values may be used to reference the correspondingly named column of detGrid. y.platform: A matrix describing the detection function used for each detection. If individual *i* was detected on occasion *j*, row *i*, column *j* is 1 if a hazard detection function was fit and 0 if a half normal detection function was fit. In this analysis, all detections were fit with a half normal detection function. habitat: A matrix holding sea surface temperature, wind speed, and depth covariate data for each sub-region. lines.arr: An array holding descriptions of aerial survey line transects. Slice *j* of the array corresponds to the *j*-th sampling occasion, and each row describes one transect. detGrid: An array describing the sub-sub-regions used to calculate detection probability for unobserved individuals. Slice *j* of the array corresponds to the *j*-th sampling occasion, and each row describes one sub-sub-region. distMat: A matrix holding the pairwise distances between each sub-region of the study area, i.e., row *i*, column *j* holds the distance between the centers of sub-regions *i* and *j*. mean.max.move and mean.ac.move: Values describing the average detected movement range of individuals. These values may be used to supply initial values to the model for the movement range. detArea: The area of one sub-sub-region from detGrid. Unit is 100km<sup>2</sup>. truncDist: The distance beyond which detection probability is fixed to zero, i.e., if the distance from a sub-sub-region to the closest transect line is greater than truncDist, detection probability is fixed to 0 for that sub-sub-region. Unit is 10km. nDetCells: The number of sub-sub-regions in the study area. nCells: The number of sub-regions in the study area. N: The number of individuals detected at least once. K and K.tot: The number of sampling occasions. K.prim: The number of time periods with covariate data, i.e., sea surface temperature and wind speed were temporally dynamic. K.sec: A vector where element *j* is the primary sampling period of sampling occasion *j*. K.covar: A vector where element *j* is the time period of the covariate data. log.fact.N: The log of the factorial of N. Value is used to calculate the likelihood. N.states: The number of states in the hidden Makov model. N.transitions: The number transitions in the covariate data, i.e., K.prim - 1. SecOcc: A matrix of eight rows, one for each time period of covariate data. The two columns are the first and last sampling occasion corresponding to the covariate time period. Area: The total area of the study region. Unit is 100 km<sup>2</sup>. tr\_b4\_occ: A vector where element *j* is the number of days between sampling occasions *j*-1 and *j*. y.sex: A vector where element *j* is 1 if individual *j* is female and 2 if individual *j* is male. pDetCount: The number of sub-sub-regions in one sub-region. detCellsIn: The number of sub-sub-regions within the truncation distance, truncDist, on each sampling occasion. LastSamplingDay\_R: The number of days between the beginning of the time series, December 1st, and the last sampling occasion. y.g and y.group: A vector where element *j* is 1 if individual *j* was not observed with a calf at any time and 2 if individual *j* was observed with a calf at least once. angleMat: A matrix of pairwise angles, in radians, between sub-regions, i.e., the element in row *i*, column *j* is the angle between the line traveling through sub-regions *i* and *j* and a line with 0 slope, e.g. the x-axis. habitat.aug and distMat.aug: Unused objects that could hold data for sub-regions outside of the study area. CovTransitions: A list of vectors. The *j*-th vector holds the days that correspond to the *j*-th covariate time period. N.covTransitions: A vector whose *j*-th element is the length of the *j*-th vector of CovTransitions. ## Code/Software Right\_whale\_scr\_models.R: Fits the right whale spatial capture-recapture models described in the manuscript. Compile\_movement\_sims\_RW: Called by Right\_whale\_scr\_models.R. Contains C++ functions used to calculate the likelihood of spatial capture-recapture models Movement\_sims\_openAC\_MLE: Called by Right\_whale\_scr\_models.R. Contains the likelihood function and code to maximize the likelihood of the right whale activity center models. Movement\_sims\_openRW\_MLE: Called by Right\_whale\_scr\_models.R. Contains the likelihood function and code to maximize the likelihood of the right whale simple random walk models. Movement\_sims\_openRW\_wDirection\_MLE: Called by Right\_whale\_scr\_models.R. Contains the likelihood function and code to maximize the likelihood of the right whale correlated random walk models. Right\_whale\_ac\_forecast.R: Calculates the likelihood of right whale activity center forecasts as described in the manuscript. References results from Right\_whale\_scr\_models.R. Right\_whale\_srw\_forecast.R: Calculates the likelihood of right whale simple random walk forecasts as described in the manuscript. References results from Right\_whale\_scr\_models.R. Right\_whale\_crw\_forecast.R: Calculates the likelihood of right whale correlated random walk forecasts as described in the manuscript. References results from Right\_whale\_scr\_models.R. Movement\_sims\_SRW.R: Conducts the simple random walk simulation study as described in the manuscript. Movement\_sims\_BRW.R: Conducts the biased random walk simulation study as described in the manuscript. Movement\_sims\_CRW.R: Conducts the correlated random walk simulation study as described in the manuscript. Movement\_sims\_SRW\_categorical\_covariate.R: Conducts the simple random walk simulation study with a categorical spatial covariate affecting movement and initial density as described in the supplemental information. Movement\_sims\_SRW\_continuous\_covariate.R: Conducts the simple random walk simulation study with a continuous spatial covariate affecting movement and initial density as described in the supplemental information.