DOI: 10.5061/dryad.vdncjsxs7
title: Accommodating the role of site memory in dynamic species distribution models

description: First-order dynamic occupancy models (FODOMs) are a class of state-space
 model in which the true state (occurrence) is observed imperfectly. An
 important assumption of FODOMs is that site dynamics only depend on the
 current state and that variations in dynamic processes are adequately
 captured with covariates or random effects. However, it is often difficult
 to understand and/or measure the covariates that generate ecological data,
 which are typically spatio-temporally correlated. Consequently, the
 non-independent error structure of correlated data causes underestimation
 of parameter uncertainty and poor ecological inference. Here, we extend
 the FODOM framework with a second-order Markov process to accommodate site
 memory when covariates are not available. Our modeling framework can be
 used to make reliable inference about site occupancy, colonization,
 extinction, turnover, and detection probabilities. We present a series of
 simulations to illustrate the data requirements and model performance. We
 then applied our modeling framework to 13 years of data from an amphibian
 community in southern Arizona, USA. In this analysis, we found residual
 temporal autocorrelation of population processes for most species, even
 after accounting for long-term drought dynamics. Our approach represents a
 valuable advance in obtaining inference on population dynamics, especially
 as they relate to metapopulations.
description: #############################################################<br> # These files were written by: G. V. DiRenzo<br> # If you have any questions, please email: grace.direnzo@gmail.com ############################################################# This repository provides the code, data, and simulations to recreate all of the analysis, tables, and figures presented in the manuscript. In this file, we direct the user to the location of files. All methods can be found in the manuscript and associated supplements. All file paths direct the user in navigating the files in this repo. #############################################################<br> ############## Objective & Table of contents ################<br> ############################################################# # File objectives & Table of contents:<br>     # 1. To navigate to files explaining how to simulate and analyze data using the main text parameterization<br>     # 2. To navigate to files explaining how to simulate and analyze data using the alternative parameterization (hidden Markov model)<br>     # 3. To navigate to files that created the parameter combinations for the simulation studies<br>     # 4. To navigate to files used to run scenarios in the manuscript<br>         # 4a. Scenario 1: data generated without site memory & without site heterogenity<br>         # 4b. Scenario 2: data generated with site memory & without site heterogenity<br>         # 4c. Scenario 3: data generated with site memory & with site heterogenity<br>     # 5. To navigate to files for general sample design guidelines<br>     # 6. Parameter accuracy, precision, and bias under different parameter combinations<br>     # 7. Model comparison under different scenarios<br>     # 8. To specifically navigate to code that recreates manuscript:<br>         # 8a. Figures<br>         # 8b. Tables<br>     # 9. To navigate to files for empirical analysis ###############################################<br> ######### 1. Main text parameterization #######<br> ############################################### To see model parameterization as written in the main text, please navigate to:<br>     /MemModel/OtherCode/MemoryMod_main.R ###############################################<br> ######### 2. Alternative parameterization #####<br> ############################################### To see alternative parameterization using a Hidden Markov Model, please navigate to:<br>     /MemModel/OtherCode/MemoryMod_HMM.R ###############################################<br> ######### 3. Parameter Combinations ###########<br> ############################################### To see how parameter combinations were generated, please navigate to:<br>     /MemModel/ParameterCombinations/LHS_parameter_combos.R To see stored parameter combinations for simulations, please navigate to:<br>     /MemModel/ParameterCombinations/parameter_combos_MemModel4.csv ##############################################<br> ######### 4a. Scenario #1 ############<br> ############################################## To simulate data WITHOUT memory and analyze using:<br>     - memory model &<br>     - first-order dynamic occupancy model Please navigate to: /MemModel/Simulations/withoutMem/Code/<br>     MemoryMod_JobArray_withoutMem.R = code to simulate & analyze data<br>     MemoryMod_JA1.sh = file to run simulations 1-5000 on HPC<br>     MemoryMod_JA2.sh = file to run simulations 5001-10000 on HPC All model output is stored in: /MemModel/Simulations/withoutMem/ModelOutput ##############################################<br> ######### 4b. Scenario #2 ############<br> ############################################## To simulate data WITH memory and analyze using:<br>     - memory model &<br>     - first-order dynamic occupancy model Please navigate to: /MemModel/Simulations/withMem/Code/<br>     MemoryMod_JobArray_withMem.R = code to simulate & analyze data<br>     MemoryMod_JA1.sh = file to run simulations 1-5000 on HPC<br>     MemoryMod_JA2.sh = file to run simulations 5001-10000 on HPC All model output is stored in: /MemModel/Simulations/withMem/ModelOutput ##############################################<br> ######### 4c. Scenario #3 ############<br> ############################################## To simulate data WITH memory and WITH site heterogenity- analyze using:<br>     - memory model &<br>     - first-order dynamic occupancy model Please navigate to: /MemModel/Simulations/Hetero/Code/<br>     MemoryMod_JobArray_Hetero.R = code to simulate & analyze data<br>     MemoryMod_JA1.sh = file to run simulations 1-5000 on HPC<br>     MemoryMod_JA2.sh = file to run simulations 5001-10000 on HPC All model output is stored in: /MemModel/Simulations/Hetero/ModelOutput ##################################################<br> ######### 5. General sample design guidelines ####<br> ################################################## To see methods for the general sample design guidelines, please navigate to:<br>     /MemModel/PostProcessingCode/Sampling_design_guidelines.R ########################################################################################################<br> ######### 6. Parameter accuracy, precision, and bias under different parameter combinations ############<br> ######################################################################################################## To see methods for model performance under different parameter combinations, please navigate to:<br>     /MemModel/PostProcessingCode/Parameter_precison_accuracy_bias.R ######################################################<br> ######### 7. Comparison of model performance #########<br> ###################################################### To see methods for model comparison, please navigate to:<br>     /MemModel/PostProcessingCode/ModelComparison.R ######################################<br> ######### 8a. Manuscript Figures #####<br> ###################################### To create parts of Figure 1 of main text (case study):<br>     - Fig 1D & 1E: /MemModel/EmpiricalAnalysis/Code/Analysis/AZ_CaseStudy.R To create Figure 2 of main text (Comparison across simulation scenarios):<br>     - /MemModel/PostProcessingCode/ModelComparison.R To create Figure S1, S2, & S3 use file:<br>     - /MemModel/PostProcessingCode/Parameter_precison_accuracy_bias.R To create Figure S4 & S5 use file:<br>     - /MemModel/PostProcessingCode/ModelComparison.R ######################################<br> ######### 8b. Manuscript Tables ######<br> ###################################### To create Table 1 of main text (General sampling recommendations):<br>     - /MemModel/PostProcessingCode/Sampling_design_guidelines.R To create Table S1:<br>     - /MemModel/PostProcessingCode/Parameter_precison_accuracy_bias.R To create Table S2:<br>     - /MemModel/EmpiricalAnalysis/Code/Analysis/AZ_CaseStudy.R To create Table S3:<br>     - /MemModel/PostProcessingCode/ModelComparison.R To create Table S4 & S5:<br>     - /MemModel/EmpiricalAnalysis/Code/Analysis/AZ_CaseStudy.R ########################################<br> ######### 9. Empirical analysis ########<br> ######################################## To recreate the empirical analysis of the case study, please navigate to:<br>     - /MemModel/EmpiricalAnalysis/Code/Analysis/AZ_CaseStudy.R