In this file, we describe the four R scripts (R Core Team, 2020) included in the supporting information that simulate data and fit the integrated spatial capture-recapture (SCR) -movement models described in Gardner, B., B. T. McClintock, S. J. Converse, and N. J. Hostetter. 2022. Integrated animal movement and spatial capture-recapture models: simulation, implementation, and inference. Ecology.
SCR WITH SIMPLE AND CORRELATED RANDOM WALKS (Section 2.2.1)sim_SCR_RandomWalks.R: This R script simulates initial abundance, initial distribution, random walk movement processes, and SCR detection processes described in the manuscript. Current settings reflect scenario 7A in Appendix S1:Table S4. All other SCR with simple and correlated random walk models described in the manuscript and appendices are fit by changing σ (movement scale parameter), σ det (detection scale parameter), λ 0 (encounter rate), γ (directional persistence parameter), and nTelem (number of telemetered individuals). Changing the current correlated random walk settings (γ > 0) to bivariate normal ("simple") random walk settings (γ = 0) requires (i) setting γ = 0 in the simulation settings, (ii) fixing γ = 0 in the NIMBLE model, and (iii) removing the initial value for γ in the initial values section (since it is fixed at 0). Section 2 within this script provides the NIMBLE models and Markov chain Monte Carlo (MCMC) settings to run the models in NIMBLE (de Valpine et al., 2017). The NIMBLE model references several functions and distributions in SCR_RandomWalks_Distributions_Samplers_and_Functions.R (described below), which improve MCMC efficiency.