Skip to content

Code and Domain Review

USGS Code and Domain Review Reviewer: Laura D’Acunto, ldacunto@usgs.gov Repository: https://code.usgs.gov/werc/dixon-field-station/halstead-lab/plethodon_occupancy_availability

Security Review I was not asked to perform a security review, so I did not examine every commit to look for PII or sensitive information. The scripts on the main branch did not seem to contain any of this information. Technical Code and Domain Review Plethodon_Occ_Avail_DAG_code.R This script ran without error and produced output matching the manuscript. Specific comments: • Some lines extend beyond the standard 80 characters, consider adjusting for easier readability. • In some DAGs, the variables are capitalized and in some they are lowercase. Suggest they be consistent throughout. • Line 70: remove commented out code. Plethodon_Occ_Avail_Data_Wrangling_code.R This script ran without error and produced output matching the manuscript. Specific comments: • Some lines extend beyond the standard 80 characters, consider adjusting for easier readability. Plethodon_Occ_Avail_Analysis_code.R The script ran with several warnings and errors. • Some lines extend beyond the standard 80 characters, consider adjusting for easier readability. • When running the models, some of them failed the first 1-3 times due to negative infinity values at the nodes and some I could not get to finish even after 10 tries. I figured this was just an issue of starting values, but there should be a comment somewhere in this script or the README.md that these models could fail initially and that if they do, the user should re-run them until they work. Alternatively, you could give the model decent starting values to avoid this issue. I unfortunately was unable to get the full model to run on my machine to examine the results and ensure they matched the output reported in the manuscript. The models I did manage to run did have the similar results (which is expected because it is a Bayesian model and no seed was set in the script). • There should be a comment that when you run the MCMCdiag() function, a warning message about the burn-in pops up. I am not familiar with Nimble, so not sure if this is something you can ignore – also, the warning message for me says burn-in = 0, though I can see in the model call there is a burn-in of 2000. This makes me nervous that something is wrong. • I also am getting a weird output (“file association invalid”) when trying to save the txt and pdf files of the MCMC trace, but it does seem to produce those files fine anyway. It might be a OneDrive problem on my end, but worth mentioning in comments if it pops up for others too.

Figure 1: Example output of a model that failed to complete due to -Inf values. General Comments The methods used in this repository are appropriate for the research question. I especially appreciated the use of DAGs to inform hypotheses and thus candidate model structures and that the authors provided code of that process in this repository along with the model code.